Skip to content

Fix model routing to read the agent-job task prompt - #66290

Merged
lpcox merged 4 commits into
mainfrom
copilot/fix-model-routing-prompt-path
Oct 6, 2026
Merged

lpcox merged 4 commits into
mainfrom
copilot/fix-model-routing-prompt-path

Conversation

Copilot AI commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Routed Copilot workflows fail before agent startup because the routing step reads an activation-only prompt path. Routing also consumes the full prompt rather than the workflow’s task text.

  • Prompt paths: Read user.txt under /tmp/gh-aw/aw-prompts on hosted runners and the runner-temp equivalent on ARC/DinD, using shared path constants.
  • Fallback: Read prompt.txt from the same directory when user.txt is missing or blank. Preserve the existing empty-prompt error and single-user-message conversation format.
  • Regression coverage: Check compiled paths for both topologies and execute the generated step against task-only, missing, and blank prompts.

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix routing-conversation step in model-routing Fix model routing to read the agent-job task prompt Oct 6, 2026
Copilot AI requested a review from lpcox October 6, 2026 22:04
@lpcox
lpcox marked this pull request as ready for review October 6, 2026 22:16
Copilot AI balanced review requested due to automatic review settings October 6, 2026 22:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

ARC/DinD routing reads runner-temp prompts before they are staged, so clean-runner workflows still fail before agent startup.

Review effort: Balanced
Findings: 1 High severity

Open (1)
What changed in this PR

Updates Copilot model routing to use the agent job’s task-only prompt, addressing #66221.

Changes:

  • Adds shared task-prompt paths and topology-based selection.
  • Falls back to the full prompt when task text is missing or blank.
  • Adds compiled-path and generated-step regression tests.
File Description
pkg/​workflow/​model_routing.go Selects routing prompt paths and adds fallback handling.
pkg/​workflow/​model_routing_test.go Tests topology paths, fallback behavior, and conversation output.
pkg/​constants/​constants.go Adds shared user.txt path constants.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread pkg/workflow/model_routing.go Outdated
Comment on lines +288 to +289
promptFilePath = constants.AwPromptsUserFileExpr
fallbackFilePath = constants.AwPromptsFileExpr
@lpcox

lpcox commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator

@copilot address review feedback

Copilot AI and others added 2 commits October 6, 2026 22:32
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>

Copilot AI commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

@copilot address review feedback

Fixed and pushed in d764fa0. ARC/DinD model routing now reads the downloaded activation prompt files before the later staging copy, with regression coverage for paths and ordering.

@lpcox
lpcox merged commit e1e92fd into main Oct 6, 2026
40 checks passed
@lpcox
lpcox deleted the copilot/fix-model-routing-prompt-path branch October 6, 2026 23:17
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.91.4

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.

Model routing: the routing-conversation step reads a prompt path that doesn't exist in the agent job

3 participants