Unify runtime composition and preflight - #117
Conversation
|
Important Review skippedToo many files! This PR contains 209 files, which is 109 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (209)
You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Gavel summary
Totals: 0 passed · 0 failed · 0 skipped · - |
Gavel crashed before producing resultsExit code: 1 Last lines of gavel.logFull |
Register the latest Claude Fable and GPT-6 Astra models with runtime availability, aliases, capabilities, pricing, and generation settings. Update family defaults so Fable and Claude resolve to Claude Fable 5.1. Claude-Session-Id: 01a07294-e289-7182-bf64-b4fdc5ab78d6
Validate complete run inputs before provider construction, setup or admission. Share actual model candidate, verifier, sandbox and constraint checks with execution while returning new capability diagnostics as warnings. Preserve model-free verification and authored requests. Cover preview side effects, fallback selection, budget ceilings and isolation fidelity with focused regressions.
Validate authored layers before composition and check the complete declared runtime after merging. Keep raw profile and chat defaults available until request resolution, with typed configuration errors and separate capability warnings. BREAKING CHANGE: aichat.RuntimeProfile now carries Composed (api.ComposedSpec). Profile providers must use api.ComposeSpecLayers and preserve its raw Trace.
Resolve cmux CLI paths reliably across PATH entries, GUI bundles, symlinks, and explicit overrides, while returning actionable errors when unavailable.
…uthored fields Centralize saved, provider, catalog, and fallback default handling at the final resolution boundary. Preserve authored zero values, compact selectors, provider aliases, and provenance while reporting unresolved modes explicitly. BREAKING CHANGE: Replace the old ApplyDefaults(model, saved), ResolveForRun, and ResolveForRunWith APIs with DefaultOptions-based ApplyDefaults.
…figuration Preserve explicitly authored zero-valued AI settings during YAML and JSON round trips, and validate saved providers, selectors, modes, and generation limits before use. Update provider access to support aliases and reject ambiguous configurations. BREAKING CHANGE: Replace AIDefaults.Provider(string) with Provider(*registry.Provider) (ProviderDefaults, string, error).
…n preservation Add explicit field presence, saved-default composition, normalization, and provenance tracking across runtime specs. Preserve authored prompt declarations and structured-output schemas through rendering and transport, while validating nested declaration fields. BREAKING CHANGE: update Render and ResolveSpecLayers callers to use the new options-based APIs.
Carry injected saved defaults through profile composition and final request resolution, while preserving explicit zero-valued JSON settings. Record the provider candidate actually selected after fallback and exclude resolution metadata from tool-approval payloads. BREAKING CHANGE: update spec composition and resolution callers to use ResolveSpecOptions.
…ution Consolidate AI runtime resolution across CLI, prompt rendering, profiles, and execution paths, preserving field provenance and explicit flag presence. Correct provider-alias configuration updates, sandbox handling, multi-runtime variant admission, structured output reporting, and transcript session linkage with expanded regression coverage. BREAKING CHANGE: Remove the legacy AIProviderOptions.ToConfig, AIRuntimeOptions.ToRequest, and prompt overlay resolution APIs in favor of unified runtime resolution.
Preserve the complete declared prompt configuration when executing named requests, including model, budget, memory, permissions, setup, and workflow settings. Extract AI runtime command registration into a dedicated module and update prompt rendering for the new options API. BREAKING CHANGE: PromptRequest no longer exposes individual prompt fields; callers must provide an api.Spec via Spec.
Claude-Session-Id: 01a072be-045a-7831-a018-238a83d1a88c
Claude-Session-Id: 01a072be-045a-7831-a018-238a83d1a88c
Claude-Session-Id: 01a072be-045a-7831-a018-238a83d1a88c
Move AI runtime command registration into the internal root command package to keep CLI command wiring modular without changing behavior. Claude-Session-Id: 01a072be-045a-7831-a018-238a83d1a88c
Claude-Session-Id: 01a072be-045a-7831-a018-238a83d1a88c
approval_execution.go carried two implementations of awaitSuspendedSeed: a free function with a 15s budget and a Service method with 5s. Production only ever called the method, so the copy the tests exercised was not the copy that ran, and the two had already drifted in both budget and error wording. Keep one — the free function, which takes an explicit store and is therefore testable — with the method's 5s budget and its richer errors, and reduce the method to resolving the store. Claude-Session: https://claude.ai/code/session_01Usd2NB1ZhiU5wMuXg76Y6W Claude-Session-Id: f046afbd-f74b-4513-b309-28a1d5c6b64c
…proval A provider approval is recorded — and so becomes visible on the session and goes out on the event stream carrying its ID — while the stream that raised it is still finishing the turn and encoding its checkpoint. Only afterwards does the prompt run reach `waiting`, the one state ResolveToolApprovalRequest accepts an answer in. Anything answering the question the moment it is asked lost that race and got a 409: a person clicking Approve promptly saw "Tool approval failed with status 409", and the mocked lifecycle suite failed the same way on CI. The store guard cannot simply be relaxed. A resolution applied before the run parks yields no continuation, and the suspension then parks the run on an already-answered approval that nothing ever resumes. So wait the parking out, bounded, the way awaitSuspendedSeed already waits out the other half of this same window — and fail loudly when it never happens, at once for a run that has already ended rather than burning the whole budget. The projection spec asserted that an early answer is refused, pinning the behaviour being changed; both halves are now covered explicitly instead. The prompt-run-conflict spec paused the first captain_prompt_runs query anywhere in the process, which the new pre-transaction read claims, so its interception is scoped to the read inside the transaction — what it always meant. Claude-Session: https://claude.ai/code/session_01Usd2NB1ZhiU5wMuXg76Y6W Claude-Session-Id: f046afbd-f74b-4513-b309-28a1d5c6b64c
git clone creates its target directory first and writes the local branch ref and
its upstream config last, so cloning straight onto the published path left a
window where the directory existed but its HEAD named a branch that did not:
`git rev-parse @{u}` there fails with "no such branch", which is how the
git-agent e2e cycle intermittently failed on CI.
Build the workspace in a staging sibling and move it in with one rename. The
path's existence now means what every observer already assumed, and an
interrupted dispatch no longer leaves behind a partial worktree that the
re-dispatch check mistakes for a finished one.
Claude-Session: https://claude.ai/code/session_01Usd2NB1ZhiU5wMuXg76Y6W
Claude-Session-Id: f046afbd-f74b-4513-b309-28a1d5c6b64c
The package hands itself a throwaway HOME so a developer's ~/.captain.yaml cannot fail specs, including the ones that shell out to a captain subprocess. But the Go toolchain derives GOPATH, GOCACHE and GOMODCACHE from HOME whenever they are unset, so the `go build ./cmd/captain` the git-agent e2e tests run inherited an empty module cache and an empty build cache and re-downloaded and recompiled the entire dependency tree, cgo sqlite3 included, on every run. On CI that was ten minutes for this one package, with the runner's warm caches sitting untouched. Resolve the three variables to absolute paths before HOME is replaced, so the isolation covers captain's config and nothing else. Measured on one e2e test against an already-warm cache: 408s before, 57s after. Claude-Session: https://claude.ai/code/session_01Usd2NB1ZhiU5wMuXg76Y6W Claude-Session-Id: f046afbd-f74b-4513-b309-28a1d5c6b64c
8ce19c5 to
48f4d28
Compare
What
Notes
PromptRequest.