Skip to content

Let a ticket's model attribute pick the model its worker launches on - #281

Merged
thrawn01 merged 8 commits into
mainfrom
thrawn01/eng-719-pick-a-workers-model-per-ticket
Nov 15, 2026
Merged

thrawn01 merged 8 commits into
mainfrom
thrawn01/eng-719-pick-a-workers-model-per-ticket

Conversation

@thrawn01

Copy link
Copy Markdown
Contributor

Purpose

One ticket sometimes wants a stronger or cheaper model than the rest, and the only way was to edit config.toml and restart dispatch, which changes every later launch too. A ticket can now say which model its worker runs on.

dispatch ticket create --attr model=opus ...      # local ticket
## Attributes                                      # Linear ticket description
model: opus

The ticket's model wins over worker_model, design_model and any harness.<name> table, for build workers, design sessions and every relaunch. A ticket with no model attribute launches as before. dispatch explain now says what each launch wanted:

launch-worker  wants launch once [launch 1791547200000 0] on model opus

Implementation

  • rules/shared.ts launchAs returns { model } alone when t.attributes.model is set. Every launch rule spreads it, so relaunches follow. An empty attribute counts as unset.
  • internal/history/explain.go reads a launch's model or harness option into new model and harness fields on ExplainLine (--json) and prints on model <name> or on harness.<name> in the text form.
  • docs/config.md and docs/rules.md name the attribute and say it wins.
  • ticket_model_test.go covers a local ticket, a Linear ticket that beats a repo table, a design ticket, and both explain forms.

Verified with make test and go test -tags tests_slow ., both passing. I ran no separate review sub-agents, so the only checks are the tests and my own read of the diff. A misspelled model fails at launch, as a misspelled worker_model does.

Fixes ENG-719

@thrawn01 thrawn01 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Read the diff against ENG-719, with one fresh reviewer reading the branch. Nothing was re-run here; the green test check is the run. Three things I'd change before merge, then notes.

  1. A whitespace model on a local ticket wins over the config (inline on rules/shared.ts).
  2. No test drives a relaunch, which is the ticket's first deliverable (inline on ticket_model_test.go).
  3. The docs still describe the old precedence in the places a reader looks first. docs/config.md:100 says worker_model is passed "for every build worker", :101-103 the same for design_model, worker and design, and the precedence paragraph at :136 goes repo table, [rules] table, worker_model with no attribute step. The override sentence landed in the [rules] intro at :96 instead. rules/config.example.toml:4-5 and :10 say the same as :100. One clause in each row and one sentence at :136 would do it.

Notes, no change asked:

  • dispatch explain shows the model only on the wants line. history.CycleLine copies Options for Wants (internal/history/history.go:533) and drops them for Waiting (:537) and Covered (:544), so a launch waiting on a slot prints no model until it is admitted. Fine for the ticket's purpose.
  • The Linear test sets the fake's Attributes map directly, so the ## Attributes description path is covered end to end only by internal/linear/client_test.go:537-581. Acceptable, since ENG-720 owns that parser.
  • Attribute keys are case-sensitive, so Model: opus is ignored without a word. A clause in docs/rules.md:80 would save someone a confused launch.
  • The Kind == "launch" test in both explain.go branches is redundant with the option lookup, since only launches carry those options. Harmless.

Comment thread rules/shared.ts Resolved
Comment thread ticket_model_test.go Resolved
@thrawn01

Copy link
Copy Markdown
Contributor Author

Docs: each [rules] row, the precedence paragraph and config.example.toml now say the ticket model wins, and docs/rules.md says attribute keys are case-sensitive. The redundant Kind == "launch" test in explain.go is gone. The Waiting and Covered lines still print no model, which I left as you said. make test and go test -tags tests_slow . pass.

@thrawn01

Copy link
Copy Markdown
Contributor Author

Read d2ff7fa against the three asks. The trim covers the blank and padded local value and keeps the config fallback for blank, the relaunch test drives relaunch-for-pr and asserts the model on the second launch, and the [rules] rows, the precedence paragraph and config.example.toml now say the attribute wins. CI is green on d2ff7fa. Nothing left from me; leaving the waits/covered explain lines as they are is fine.

@thrawn01

Copy link
Copy Markdown
Contributor Author

Added a sentence to skills/ticket/SKILL.md so an agent asked to file a ticket on a given model writes model: opus (or --attr model=opus for a local ticket) instead of guessing or calling it impossible. Docs only, no code change.

@thrawn01
thrawn01 merged commit 9e83c2b into main Nov 15, 2026
2 checks passed
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.

1 participant