Skip to content

fix(automation): keep @opencode-agent mention payloads within GitHub's 10-key limit - #1115

Open
seonghobae wants to merge 2 commits into
mainfrom
cursor/mention-payload-ten-keys-82e4
Open

fix(automation): keep @opencode-agent mention payloads within GitHub's 10-key limit#1115
seonghobae wants to merge 2 commits into
mainfrom
cursor/mention-payload-ten-keys-82e4

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Summary

@opencode-agent mention pings could not enqueue a review. Both mention repository_dispatch hops sent a 14-key client_payload. GitHub's create-repository-dispatch endpoint allows 10 top-level properties and rejects the rest with HTTP 422.

This PR cuts those payloads to ≤10 keys while keeping enough identity for the review dispatch (owner/repo, PR, head SHA, comment id / invocation key). The OpenCode invocation-claim key layout is unchanged: review-only flags stay bound in the SHA-256 claim and are hardcoded in the wrapper.

Payload key counts

Hop Before After
Router → agent-mention-opencode 14 9
Wrapper → merge-scheduler (mention-forwarder) 14 10
Router → agent-mention-noema 9 9 (unchanged)
Wrapper → noema-review 9 9 (unchanged)

Dropped from the first hop: trigger_reviews, review_dispatch_limit, enable_auto_merge, update_branches, merge_mode (constants already bound in the invocation claim).

Dropped from the merge-scheduler forwarder: trigger_reviews (scheduler default is true), review_dispatch_limit (scheduler default is 1), requested_agent, requested_by. Kept the three flags that override scheduler defaults (enable_auto_merge=false, update_branches=false, merge_mode=disabled) so a mention cannot merge.

Out of scope

Verification

Local quality gate (same command as agent-mention-router-quality-ci.yml):

  • 1120 passed, 16 subtests passed
  • mention-script coverage 100% (agent_mention_router.py + agent_mention_sweep.py)
  • interrogate 100%
  • git diff --check clean
  • GitHub reports mergeable: MERGEABLE against main

Contract test tests/test_agent_mention_dispatch_payload_limit.py fails if any mention client_payload has more than 10 keys. Router helper repository_dispatch_body() fails closed before GitHub can return 422.

GitHub docs: Create a repository dispatch event — "The maximum number of top-level properties is 10."

Open in Web Open in Cursor 

Summary by CodeRabbit

  • 개선 사항

    • 자동화 요청 전달 형식을 표준화하고, 전달 가능한 항목 수를 제한해 처리 안정성을 높였습니다.
    • 병합 및 브랜치 업데이트 설정이 후속 처리 단계에서도 일관되게 비활성화됩니다.
    • 자동화 호출에 필요한 저장소, 변경 요청, 커밋, 브랜치 및 요청 정보는 계속 전달됩니다.
  • 검증

    • 요청 형식과 필수 항목, 항목 수 제한을 검증하는 테스트를 추가했습니다.
    • 병합 방지 설정과 민감한 실행 옵션이 의도대로 적용되는지 확인합니다.

@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review available on request

  • 🔍 Trigger review

Reviews should be triggered manually for repositories with fewer than 10 stars. Select Trigger review above or comment @coderabbitai review to review the latest changes. For a full review, comment @coderabbitai full review.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1cd88714-1c5f-45ec-bf94-b1325d5f5098

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 5f483417-18ee-4b44-ae48-1cd910e96893

📥 Commits

Reviewing files that changed from the base of the PR and between c47afc2 and 8aa06f5.

📒 Files selected for processing (6)
  • .github/workflows/agent-mention-opencode-dispatch.yml
  • docs/automation/review-agent-comment-invocation.md
  • scripts/ci/agent_mention_router.py
  • tests/test_agent_mention_complete_payload_binding.py
  • tests/test_agent_mention_dispatch_payload_limit.py
  • tests/test_agent_mention_router.py

Included review availability: Your plan includes up to 1 review per rolling hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

OpenCode 디스패치 페이로드 생성을 공통화하고 최상위 키를 10개로 제한합니다. 병합 관련 플래그는 첫 디스패치에서 제거하고 invocation claim과 wrapper 단계에서 고정된 비활성화 값으로 전달합니다. 테스트는 이 계약과 워크플로 동작을 검증합니다.

Changes

OpenCode 디스패치 흐름

Layer / File(s) Summary
디스패치 페이로드 계약
scripts/ci/agent_mention_router.py, tests/test_agent_mention_router.py
repository_dispatch_body가 최상위 client_payload 키를 10개로 제한합니다. Noema 및 OpenCode 디스패치가 공통 검증 함수를 사용합니다. OpenCode 페이로드에서 병합 및 리뷰 제어 플래그를 제거합니다.
워크플로 설정 바인딩
.github/workflows/agent-mention-opencode-dispatch.yml, docs/automation/review-agent-comment-invocation.md, tests/test_agent_mention_complete_payload_binding.py
워크플로가 리뷰 및 병합 설정을 고정값으로 설정합니다. agent_invocation_key와 요청 식별 정보를 유지합니다. 병합 방지 플래그는 invocation claim과 wrapper 전달 단계에 유지됩니다.
페이로드 제한 검증
tests/test_agent_mention_dispatch_payload_limit.py
10개 키 제한, 필수 키, 워크플로 전달 키와 OpenCode 제외 키를 검증합니다. 11개 키 페이로드는 ValueError로 거부되는지 확인합니다.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Merge Risk: ⚪ Minimal · up to 8aa06

The change keeps mention dispatch payloads within GitHub’s 10-key limit and adds fail-closed validation with passing checks; no actionable merge-blocking risk remains after normal review.

Sequence Diagram(s)

sequenceDiagram
  participant agent_mention_router
  participant GitHub repository_dispatch
  participant OpenCode workflow
  participant agent_invocation_claim
  participant merge-scheduler wrapper
  agent_mention_router->>agent_mention_router: repository_dispatch_body로 페이로드 키 수 검증
  agent_mention_router->>GitHub repository_dispatch: 식별 정보와 agent_invocation_key 전달
  GitHub repository_dispatch->>OpenCode workflow: 제한된 client_payload 전달
  OpenCode workflow->>agent_invocation_claim: 고정된 리뷰 및 병합 설정과 호출 정보 전달
  agent_invocation_claim->>merge-scheduler wrapper: 병합 비활성화 설정 전달
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 OpenCode 멘션 payload를 GitHub의 10개 키 제한 내로 유지하는 주요 변경 사항을 정확하고 간결하게 설명합니다.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/mention-payload-ten-keys-82e4

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@seonghobae
seonghobae marked this pull request as ready for review August 17, 2026 20:49
@cursor

cursor Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@seonghobae

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Already reviewed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

…y limit

@opencode-agent mentions could not enqueue because both the first-hop
wrapper payload and the merge-scheduler forwarder sent 14 client_payload
keys. GitHub's repository_dispatch API allows 10 and returns HTTP 422.

Keep identity on both hops, bind review-only flags in the invocation
claim, hardcode those flags in the wrapper, and fail closed if a payload
grows past 10 keys.

Co-authored-by: Seongho Bae <[email protected]>
@cursor
cursor Bot force-pushed the cursor/mention-payload-ten-keys-82e4 branch from 8aa06f5 to 730508a Compare August 18, 2026 01:27
@seonghobae

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown
⚠️ Action not completed

No files to review.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants