assign_copilot_to_issue_with_intent assigns Copilot but the agent session never starts
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- api, backend-api-design, tooling
Hướng nghiên cứu
Bắt đầu trong pkg/github/copilot.go và lần theo AssignCopilotToIssueWithIntent đến app/platform/mutations/update_issue.rb, đặc biệt là các đường dẫn được nêu liên quan đến assignee, copilot_context và validation. Tái hiện bản cập nhật GraphQL dạng object trong một repository có thể ghi, so sánh các lỗi thực thi và các yêu cầu job-secret tiếp theo với việc gán thủ công, đồng thời xác minh rằng chỉ báo thành công chỉ được báo khi phiên agent có thể bắt đầu.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
assign_copilot_to_issue_with_intent reports success and Copilot is genuinely assigned to the issue, but no coding agent session is ever created. The user sees:
The agent encountered an error and was unable to start working on this issue: This may be caused by a repository ruleset violation. See granting bypass permissions for the agent, or please contact support if the issue persists.
Assigning Copilot manually to the same repository, moments later, works end to end.
That error text is misleading: I checked, and no ruleset denial occurred (details below). Granting bypass permissions will not help, so it is worth correcting expectations for anyone who hits this.
Reproduction
Observed on github/padawan-testing-staging-jedi-knight (repo id 1042304088), issue #1065, 2026-09-15 14:00 UTC.
Tool call, from the calling agent's log:
{"owner":"github","repo":"padawan-testing-staging-jedi-knight","issue_number":1065,
"is_suggestion":false,"confidence":"HIGH",
"rationale":"Issue requests repository research and a report, ...",
"custom_instructions":"Continue the repository research requested in the issue ..."}
Result (success=true):
{"is_suggestion":false,"issue_number":1065,"message":"successfully assigned copilot to issue - pull request pending", ...}
Evidence
Comparing the failing tool-driven assignment (#1065) against a manual assignment on the same repo two minutes later (#1066), from request logs:
| Step | #1065 (tool) | #1066 (manual) |
|---|---|---|
GraphQL updateIssue |
200 | 200 |
UpdateIssueOrchestration |
completed 14:00:11.679 | completed |
GET /repos/.../rules/branches/copilot/task-... |
never called | 200 at 14:01:27.9 |
GET /repos/.../agents/secrets and /agents/variables |
never called | 200 at 14:01:30 |
| "Copilot SWE agent job secret mint result" | absent | 3x at 14:02:38-42 |
So the assignment mutation succeeds and the orchestration completes, but nothing downstream ever runs.
On the ruleset claim: every Repositories::RuleSuite evaluation for this repo in the window was on refs/heads/main for the other PR's merge check (license compliance + required workflows). Nothing evaluated a copilot/* branch for #1065.
Where the two paths diverge
The intent tool uses the object form, whereas the legacy tool and the UI use assignee IDs:
AssignCopilotToIssue(pkg/github/copilot.go):UpdateIssueInput{ AssigneeIDs: actorIDs, AgentAssignment: ... }AssignCopilotToIssueWithIntent:UpdateIssueInput{ Assignees: assignees }, withAgentAssignmentset only when!IsSuggestion
github/github declares these mutually exclusive and handles them on separate branches in app/platform/mutations/update_issue.rb. The object form routes through process_intents_via_processor, sets agent_bots_prevalidated = true, and takes a different validation branch (validate_agent_assignment_authorization! rather than validate_agent_bot_assignments!).
Candidate mechanisms
I could not discriminate between these without stepping through the intent processor at runtime, so I am listing them rather than asserting one.
- The
writable_by?strip.update_issue.rb:384-390adds aForbiddenexecution error and then removes the new agent bots fromattributes.assigneeswhile continuing with the rest of the update.copilot_contextstaysnil, so no token is minted and no session starts. Because the intent processor persists the assignment atomically viatrigger_assigned_event(see the comment at:255), the issue can still show Copilot assigned. This matches the symptom most closely. - The
copilot_contextgate.update_issue.rb:374-382only buildscopilot_contextwheninputs.key?(:assignees) && present?and a new agentic bot id is found.inputs[:assignees]is left unset whenapplied_actorsis empty (:268-270). - Empty-string
customAgent. Both assign tools sendCustomAgent: &emptyString;omitemptyon*githubv4.Stringonly drops a nil pointer, so"customAgent": ""goes on the wire where the UI omits it. This is common to both tools, so it does not by itself explain why only the intent tool fails, but it is worth tightening regardless.
Suggested next step
The cheapest discriminator is a direct GraphQL call: updateIssue with object-form assignees plus agentAssignment, against a repo where the caller is known to be writable, then check whether a job secret mint follows. If mechanism 1 is correct, the response will carry a Forbidden execution error alongside a successful-looking payload.
Independently of the root cause, two small hardening changes look worthwhile in this repo:
- Only populate
CustomAgent/CustomInstructionswhen non-empty, rather than pointing at"". - Surface GraphQL execution errors from the assignment mutation in the tool result, so the tool does not report
successwhen the agent assignment half of the mutation was rejected.
Filed from an investigation into why automations that select this tool never produce a session. Happy to provide the full request-log trace.
- Ngôn ngữ chính
- Go
- Star
- 33.1k
- Fork
- 5k
- Merge trung bình
- 2 ngày 15 giờ
- Pull request đã merge (30 ngày)
- 27
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của github/github-mcp-server
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
github/github-mcp-server#3235 ·
-
enhancement
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
github/github-mcp-server#3042 · 2 bình luận ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
github/github-mcp-server#3032 · 1 reaction ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
github/github-mcp-server#2803 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
github/github-mcp-server#2740 ·
Tất cả issue của github/github-mcp-server
Issue tương tự
-
kind/bug needs-triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
matrixorigin/matrixone#29223 ·
-
needs-acceptance wg/data-plane-networking
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
vllm-project/semantic-router#4024 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
alexgorbatchev/dotfiles#107 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 84/100