fix: dispatch workers with /address-issue <id> only (#118)#119
Open
polymath-orchestrator wants to merge 2 commits into
Open
fix: dispatch workers with /address-issue <id> only (#118)#119polymath-orchestrator wants to merge 2 commits into
polymath-orchestrator wants to merge 2 commits into
Conversation
BuildIssuePrompt previously dumped the issue title/url/labels/body plus an "implement the change… open a PR" footer into the worker's spawn prompt. That is exactly the long custom prompt GH #118 bans: the worker's /address-issue router is self-sufficient (resolves the repo, reads the issue, claims, works, reviews, writes durable progress back to the ticket), so it needs only the issue reference. BuildIssuePrompt now returns exactly `/address-issue <id>`. intakeIssueRef reduces the canonical native id (owner/repo#N for GitHub) to the number the skill consumes; it falls back to the trimmed native for providers without a '#'. The now-dead body-dump truncation machinery (footer, notice, cap, truncateUTF8, maxIntakePromptLen) is removed. The canonical id still rides in the session's IssueID env — only the prompt is trimmed. Regression tests assert the exact `/address-issue <id>` form and that no issue context leaks into the prompt. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015EGzowftkQ6X38TDKjH24Y
orchestratorPrompt taught coordinators to `ao spawn … --prompt "<clear worker task>"`, i.e. to hand-write a long task description for every worker — the root cause GH #118 targets on the orchestrator side. The prompt now shows `--prompt "/address-issue <issue-id>"` and states plainly that every worker is dispatched with exactly `/address-issue <issue-id>` and nothing more, because the router is self-sufficient and durable context lives in the ticket. Touches a sensitive path (session_manager); full CI run per commit. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015EGzowftkQ6X38TDKjH24Y
6 tasks
There was a problem hiding this comment.
Pull request overview
This PR updates the backend daemon’s two worker-dispatch surfaces to emit only a /address-issue <id> router invocation (instead of long, hand-shaped prompts), aligning intake + orchestrator behavior with GH #118’s “router-only dispatch” contract.
Changes:
- Updated the orchestrator system prompt to instruct spawning workers with
--prompt "/address-issue <issue-id>"and explicitly forbid custom task prompts. - Simplified tracker intake worker prompts to
"/address-issue <ref>"and removed the old issue body dump + truncation/footer machinery. - Updated/added regression tests to pin the new router-only prompt behavior and ensure the old guidance/prompt content is gone.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| backend/internal/session_manager/manager.go | Orchestrator system prompt now teaches router-only worker dispatch. |
| backend/internal/session_manager/manager_test.go | Regression assertions for the updated orchestrator prompt + removal of old guidance. |
| backend/internal/observe/trackerintake/observer.go | Intake prompt generation now returns only /address-issue <id>; removed prompt-capping/body-dump logic. |
| backend/internal/observe/trackerintake/observer_test.go | Regression tests updated to assert exact router-only intake prompts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+442
to
+447
| // intakeIssueRef reduces a canonical tracker id to the reference the | ||
| // `/address-issue` skill consumes. GitHub's native form is "owner/repo#123" and | ||
| // the skill wants the issue number (it resolves the repo itself from the | ||
| // worker's environment), so everything after the last '#' is the reference. A | ||
| // native id without a '#' is passed through trimmed, so non-GitHub providers | ||
| // still yield a resolvable argument instead of an empty one. |
Comment on lines
+416
to
+418
| // TestBuildIssuePromptRefFallsBackToNative covers a native id that carries no | ||
| // "#N" suffix: the whole trimmed native is used verbatim so the worker still | ||
| // gets a resolvable reference rather than an empty argument. |
Author
|
Final-review (independent, claude/fable — cross-family to the codex implementer): CLEAN. No medium+ findings.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes part of #118 (the ao-daemon half — intake + orchestrator dispatch surfaces). The sx-skills half (durable progress written to the ticket at each phase; AC #3) lives in the separate
sxasset system and is tracked/synced there, not in this repo.What changed
Two dispatch surfaces stopped emitting long, hand-shaped worker prompts and now emit exactly
/address-issue <id>:trackerintake/observer.go) —BuildIssuePromptdumped the full issue (title/url/labels/body) + an "implement the change… open a PR" footer. It now returns exactly/address-issue <id>. NewintakeIssueRefreduces the canonical native id (owner/repo#Nfor GitHub) to the number the skill consumes, falling back to the trimmed native for a#-less id. The dead body-dump truncation machinery (intakePromptFooter,intakePromptTruncationNotice,maxIntakePromptLen,capIntakePrompt,truncateUTF8) is removed. The canonical id still rides in the session'sIssueIDenv — only the prompt is trimmed.session_manager/manager.go) —orchestratorPrompttaught coordinators toao spawn … --prompt "<clear worker task>". It now shows--prompt "/address-issue <issue-id>"and states plainly that every worker is dispatched with exactly/address-issue <issue-id>and nothing more, because the router is self-sufficient and durable context lives in the ticket.Why
The router
/address-issuealready resolves the repo, reads the issue, claims, works, reviews, and (via the skills half) writes durable progress back to the ticket. Handing workers a long custom prompt is redundant and fragile — context in a spawn prompt dies with the session; context in the ticket survives and lets a resumed/replacement worker pick up from the id alone.Acceptance criteria coverage (ao half)
/address-issue <id>— regression testTestBuildIssuePromptIsRouterInvocationOnly+TestPollSpawnsWorkerForEligibleIssue/address-issue <id>only —TestSpawnOrchestrator_UsesCoordinatorPromptasserts the new form and that<clear worker task>is gone/address-issue <id>form)sxVanilla rule / upstream
Both files are backend/daemon code under the hard vanilla rule. Changes are upstream-shaped (prompt content only, no structural fork). An upstream PR will be opened for the intake + orchestrator prompt changes; we carry the delta here.
session_manager/**is a sensitive path — autonomous merge parks this for a human reviewer by policy.Testing
go build ./...,go vet ./...,go test ./...— all greengolangci-lint run(v2.12.2) on changed packages — 0 issuesgofmt -l— clean🤖 Generated with Claude Code
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.