feat(agent): add bounded auto and cold fast modes - #74730
Conversation
|
P1 managed-stream cutoff finding — Fixed in Every final managed provider stream factory now revalidates dynamic fast metadata immediately before OpenAI, Anthropic, or Bedrock client dispatch, after Relay supplies its final kwargs. Deterministic regressions cross the 60-second cutoff inside Relay and prove stale priority/speed metadata is absent at each final callback. |
|
P2 custom OpenAI-compatible endpoint finding — Fixed in Dynamic OpenAI Priority Processing now fails closed unless runtime identity is an exact supported native pairing: direct OpenAI provider plus |
|
Exact-head independent runtime/cost review passed for The review confirmed both prior findings are fixed:
The delta also preserves request-local copying, static normal/fast behavior, prompt/tool/message stability, summary behavior, persisted-history cold eligibility, and exact UI/session mode state. Current-head affected validation: 306 tests passed; changed-file Ruff and Remaining gate: exact-head CI is |
5579f28 to
68db2d4
Compare
|
Current-main refresh complete.
No merge, release, runtime, or CI-approval claim. |
|
Final rebase-delta review passed for exact head Range-diff confirmed the runtime/cost review-fix commit is patch-identical. The feature patch differs only by the expected current-main Desktop API integration ( Rebased-head validation: 327 focused tests passed; changed-file Ruff and Remaining gate: exact-head CI is |
|
Current-main follow-up: after the exact rebase base Remaining gate: exact-head CI is |
|
Thanks for the careful reimplementation across the agent and UI surfaces. Current main still supports only normal/priority parsing in No blocking defect was identified in the inspected diff. The PR is currently mergeable according to GitHub; external-fork CI remains unapproved. Automated hermes-sweeper review. |
|
Like #83166, this PR is stale against current main and bundles five separable concerns, so I'm splitting it into single-concern PRs rather than pushing a 42-file rebase. Slice 1 is up: #89960 — Planned follow-ons: (2) idempotent Anthropic fast-mode kwargs helper, (3) the bounded-auto policy, (4) the cold-fast mode + identity threading that activates the slice-1 gate, (5) CLI/config surface. I'll file them in order as each is rebased and green, then close this omnibus once slice 1 lands or is cherry-picked. teknium — you'd marked this on the premise (current main still parses only normal/priority in ); the split is to get it under the review bar. |
|
Closing this omnibus — it's fully replaced by single-concern PRs on current main, each with its own tests, which is much easier to review than this 42-file diff:
The only part not yet re-filed is the user-facing surface ( |
What does this PR do?
Reimplements bounded
autoandcoldpolicies for the existing fast mode on currentmain.normalcoldautofastThe opening window defaults to 60 seconds and is configurable with
agent.fast_auto_on_seconds. The policy starts at conversation ingress and is revalidated immediately before every provider dispatch, including streaming, non-streaming, retries, tool-loop continuations, iteration-limit summaries, and final managed-stream callbacks after Relay processing.coldderives eligibility from persisted logical-session transcript activity. Explicitly empty or system-only history remains eligible; prior user, assistant, or tool activity does not.Only request-local provider metadata changes. Conversation messages, prompts, tool schemas, and persisted request overrides remain unchanged for prompt-cache stability. Existing
normalandfastbehavior is preserved.Dynamic OpenAI Priority Processing is emitted only for confirmed native OpenAI or exact ChatGPT Codex provider/host/API-mode identities. Custom, compatible, and lookalike endpoints fail closed. Anthropic keeps its existing native-endpoint gate.
CLI, messaging gateway, TUI, and Desktop surfaces preserve and display all four exact modes. The Desktop session-create contract sends the exact
service_tierwhile retaining the legacyfastfield for older gateway compatibility.Supersedes #64786.
Fixes #64785.
Validation
git diff --checkpassed.68db2d4b64451c446bf02ae515972c6a4ca3f3f5, rebased ontoc581ad402e942c8ab5ce7eb0be325b33061d17bb:git diff --checkpassed.Review and CI gates
68db2d4b64451c446bf02ae515972c6a4ca3f3f5, including request-local policy state, final provider-boundary cutoff enforcement, unsupported endpoint denial, persisted-history cold eligibility, prompt/tool/message stability, and exact CLI/gateway/TUI/Desktop mode preservation.action_required; an upstream maintainer must approve the external-fork workflow before CI can run.Scope
This PR is source, focused-test, and independent-review evidence only. It does not claim CI pass, merge, release, deployment, installed-runtime, paid-provider canary, or customer-runtime proof.