Repository navigation
fix(goal): judge on the session's selected model (+ goal_wait gating, compact resume, model picker) - #1022
Merged
Conversation
Owner
Author
|
!pizza - fix the checks |
Owner
Author
|
✅ Fixed and rebased onto origin/main (97fddbc). Pushed head: 0b6db24.
Verification:
PR is mergeable. Not merged or deployed. |
…ompact resume, evaluator model picker - The /goal LLM evaluator always runs on the session's currently selected model unless goal.evaluatorModel pins one. Removed the cache-miss downgrade to the cheapest authenticated model; an unusable pinned model now falls back to the session model. - Session-context reuse passes the pi sessionId so providers keyed on it (openai-codex prompt_cache_key) can hit the session's prompt cache. - goal_wait is only an active tool while a goal is active. - Manual /compact resumes an active goal once the session is idle. - Runner settings: evaluator model picker (default: Session model).
Pizzaface
force-pushed
the
fix/goal-session-model
branch
from
November 5, 2026 18:38
c40c41e to
0b6db24
Compare
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.
Summary
/goaljudged most checks on the cheapest authenticated model, not the session's model. It reused the session context on the session model only until the first evaluation withcacheRead = 0, then switched to the cheapest non-reasoning text model for the rest of the session. Onopenai-codexthat miss was close to guaranteed: the judge call never passedsessionId, which is what pi turns intoprompt_cache_key.Changes
Evaluator model (
goal/index.ts,evaluator.ts,session-context.ts)ctx.model) unlessgoal.evaluatorModelpins one.sessionId, so prompt caching can apply.uncertainand logs a warning.recordCacheOutcome,isCacheReuseViable) and the cheapest-model lookup (findSmallFastModels).Other goal fixes included in this PR (also not yet in main)
goal_waitis only an active tool while a goal is active./compactresumes an active goal once the session is idle with nothing queued. Before, the aborted run left the goal loop stalled.Docs: removed the "cheapest authenticated model" wording from
features/goals.mdxandcustomization/configuration.mdx.Trade-off
If the cache misses, each check pays full input price on the session model. It no longer switches to a cheap model.
Tests
bun test packages/cli/src/extensions/goal/: 124 pass. New tests:sessionIdis forwarded to the provider call.goal_waitgating./compact.GoalEvaluatorSettings.test.tsx: 4 pass.