fix(copilot): forward role-specific model config to launch and restore#2975
fix(copilot): forward role-specific model config to launch and restore#2975anmol0b wants to merge 1 commit into
Conversation
|
Thanks for contributing to Agent Orchestrator. This PR is being picked up by the current external contributor on-call pair: If someone is already working on this, please continue as usual. For faster context or live questions, you can also join the AO Discord. Join the session here: Come by if you want to see what is being built, ask questions, or just hang around with the community. |
codebanditssss
left a comment
There was a problem hiding this comment.
Code is correct and go test ./internal/adapters/agent/copilot/... is green locally, all 9 checks green. The blank/whitespace guard and the byte-for-byte-unchanged-when-unconfigured property both hold.
One thing surfaced by reading this next to #2985, which I looked at just before this. The two PRs take opposite positions on the restore path, and I don't think either is wrong — but the series would be easier to follow if it said why. Detail inline.
For what it's worth, both positions have precedent in the tree: codex wires restore (codex.go:151), claudecode doesn't. So this isn't a case of one of them being a mistake.
|
Following up on my earlier question about whether @Hardik180704 checked the equivalent composition against a real CLI in #2989:
That doesn't settle this PR — Copilot uses Given you wired restore here and deferred it in #2985 for exactly this reason, one run of Still not blocking from my side — codex sets precedent for wiring restore, so this isn't wrong as it stands. |
|
Thanks for this — the code is clean (gofmt/vet clean, tests pass locally) and the launch path is well-grounded: One thing I'd like evidence on before merging: the restore path. This PR also appends The Copilot CLI docs describe Could you add a bit of evidence that If it turns out resume doesn't honor |
Pulkit7070
left a comment
There was a problem hiding this comment.
Reviewed against the model-config adapter family pattern. go test ./internal/adapters/agent/copilot -count=1 passes, go vet clean, go build ./... clean, gofmt -l clean.
Matches the established pattern:
appendModelFlagtrims and no-ops on blank/whitespace.- Launch and restore both append
--modelafter approval flags and before--agent/--interactive <prompt>, so it is ahead of the positional prompt. GetConfigSpecadvertises themodelfield with a good description including an example.- Tests cover launch + restore + blank + configspec, plus a canceled-context check. Nice.
Non-blocking note inline about the helper signature.
| // whitespace-only value is omitted so Copilot falls back to its own default | ||
| // resolution (COPILOT_MODEL env, or its configured default) exactly as an | ||
| // unconfigured launch would. | ||
| func appendModelFlag(cmd *[]string, model string) { |
There was a problem hiding this comment.
Consistency nit (non-blocking): the sibling adapters and codex take appendModelFlag(cmd *[]string, cfg ports.AgentConfig) and trim cfg.Model inside. Here it takes a string and the caller passes cfg.Config.Model. Functionally identical and arguably cleaner, just flagging the divergence in case the family is meant to stay uniform.
What
Adds appendModelFlag to the GitHub Copilot adapter, called from both GetLaunchCommand and GetRestoreCommand, so a configured agentConfig.model is forwarded as --model to the copilot CLI. Also adds a GetConfigSpec override advertising the model field, matching claude-code, codex (#2869), and kiro (#2932).
Why
Fixes #2895. A worker/orchestrator configured with a specific model silently fell back to Copilot's global default because the adapter never read cfg.Config.Model — same root-cause pattern as #2769 (Codex) and #2897 (Vibe) in this audit series.
How
Testing
All existing tests pass, plus:
Checklist
main(or continuing an existing PR branch)go, frontend, etc.)