This release adds file autocomplete to the lean TUI, fixes several tab and session management bugs, improves MCP callback safety under concurrent use, and introduces multiple new lint rules to enforce codebase consistency.
What's New
- Adds
@file autocomplete to the lean TUI, reusing VCS-aware file discovery and fuzzy matching, and preserving surrounding editor text when inserting selected paths - Adds request-time
TokenSourceauthentication for OpenAI and Vertex AI providers - Adds request-scoped MCP callbacks (elicitation, sampling, OAuth) via a new
HandlerScopetype, preventing cross-request callback collisions; also adds safe MCP routing and multi-subscriber event delivery - Adds lint rule to enforce shared tool argument decoding via
tools.UnmarshalToolArgumentsinstead of rawjson.Unmarshal - Adds lint rule to reject branching on
err.Error()string content (strings.Contains,strings.HasPrefix,strings.HasSuffix) - Adds lint rule to prevent direct
os.Stdoutwrites in library packages underpkg/ - Adds lint rule to enforce
DOCKER_AGENT_environment variable prefix, flagging legacyCAGENT_*names - Adds lint rule to require
atomicfile.Writefor marshalled state instead ofos.WriteFile - Adds lint rule to flag bare
&http.Client{}without an explicitTransport - Adds lint rule to sync the Toolset schema enum with
DefaultToolsetCreators - Adds lint rule to enforce state paths go through
pkg/pathsinstead of hard-coded.cagentliterals
Improvements
- Fuses assistant line styling and measurement into a single pass in the TUI, reducing redundant work on large message histories
Bug Fixes
- Fixes
token_keynot being read in the Anthropic and Gemini clients; they now checktoken_keybefore falling back to their native environment variables - Fixes lean TUI not finalizing in-flight tool calls when a stream stops without a tool response; interrupted tools are now rendered as errors before the cancellation marker
- Fixes TUI scoping of asynchronous input results and dialogs to their originating page, preventing responses from appearing in the wrong tab or on stale UI state
- Fixes TUI session identity tracking by separating the live session ID from the immutable tab routing key, and preserving the previous session ID when clearing a tab
- Fixes attention dialogs racing with tab switches and surviving their page lifetime by serializing attention delivery on the owning tab
- Fixes the API server not forwarding the agent config envelope in gateway-bound requests
- Fixes CI failure reporting to read job logs through the API (instead of
gh run view --log-failed) and to allow ANSI escape sequences in log output
Technical Changes
- Refactors
StartableToolSetto be the single lifecycle owner for toolset startup, removing parallel state machines in Code Mode - Refactors toolset startup coordination into a unified
StartToolSetsfunction inpkg/tools - Centralizes model provider interfaces (
Provider,EmbeddingProvider,BatchEmbeddingProvider,RerankingProvider) into a singlepkg/model/provider/contractspackage - Replaces
ProviderRegistry anyfield with a typedRebuildProviderFuncclosure to eliminate unsafe type assertions - Centralizes per-request gateway HTTP client setup into
base.NewGatewayClient, removing duplicated boilerplate across OpenAI, Anthropic, and Gemini providers - Extracts shared
instrumentedBasestruct for capability-specific tracing wrappers, removing duplicated method bodies - Defers
GatewayToolsettemp-file creation toStart/Restartso secrets are not written to disk until the subprocess launches - Refactors TUI to return explicit
UpdateEffectsfromchat.Updateinstead of using a routed-timer contract - Refactors TUI attention dialog handling into a dedicated
attention.gofile - Introduces
tabstatepackage to hold synchronized per-tab status and attention state shared between the tab renderer and the owning tab
What's Changed
- docs: update CHANGELOG.md for v1.139.0 by @docker-read-write[bot] in #4264
- feat(lint): enforce shared tool argument decoding by @dgageot in #4265
- feat(lint): add ErrorStringMatching cop and fix call sites by @dgageot in #4266
- feat(lint): add EnvironmentVariablePrefix cop and migrate pprof to DOCKER_AGENT_PPROF_ADDR by @dgageot in #4269
- perf(tui): fuse assistant line styling and measurement by @dgageot in #4263
- feat(lint): add NoStdoutInLibraries cop and fix pkg/ violations by @dgageot in #4267
- refactor(tools): establish StartableToolSet as single lifecycle owner by @dgageot in #4271
- refactor(provider): centralize model provider interfaces in contracts package by @dgageot in #4272
- fix(tui): fix session identity, attention state, and /clear persistence across tabs by @dgageot in #4270
- feat(lint): require atomicfile.Write for marshalled state by @dgageot in #4275
- refactor(provider): replace ProviderRegistry any with typed RebuildProviderFunc by @dgageot in #4278
- feat(lint): add HTTPClientTransport cop to flag bare &http.Client{} without Transport by @dgageot in #4276
- refactor(tools): unify toolset startup coordination by @dgageot in #4277
- feat(lint): sync Toolset schema enum with DefaultToolsetCreators by @dgageot in #4273
- fix(tui): scope asynchronous results and dialogs to their originating page by @dgageot in #4279
- feat(lint): add StatePathViaPathsPackage cop and fix call sites by @dgageot in #4274
- refactor(tui): replace routed-timer contract with explicit UpdateEffects by @dgageot in #4283
- refactor(provider): centralize per-request gateway client setup by @dgageot in #4281
- feat(tools): request-scoped callbacks, safe MCP routing, and multi-subscriber event delivery by @dgageot in #4282
- refactor(mcp): make GatewayToolset construction side-effect free by @dgageot in #4286
- refactor(provider): compose capability-specific tracing wrappers by @dgageot in #4287
- fix(ci): read job logs through the API so main failures get reported by @aheritier in #4288
- test(tui): freeze the animation clock in the scrolled-up stream program test by @aheritier in #4289
- fix(tui): serialize attention delivery on the owning tab by @dgageot in #4290
- fix: read token_key in the Anthropic and Gemini clients by @IsmaelMartinez in #4285
- feat(provider): add request-time TokenSource authentication for OpenAI and Vertex AI by @dgageot in #4280
- feat(leantui): add file autocomplete by @rumpl in #4295
- fix(leantui): finalize interrupted tool calls by @rumpl in #4297
- docs: auto-update for merged PRs (2026-09-15) by @aheritier in #4299
- fix(server): forward the agent config envelope in API-server mode by @gtardif in #4291
- fix(ci): let gh print job logs that contain ANSI escapes by @aheritier in #4293
- ci: skip lint and test jobs on a main push the merge queue already tested by @aheritier in #4296
New Contributors
- @IsmaelMartinez made their first contribution in #4285
Full Changelog: v1.139.0...v1.140.0