Skip to content

v1.140.0

Latest

Choose a tag to compare

@docker-read-write docker-read-write released this 15 Sep 08:13
· 13 commits to main since this release
b759028

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 TokenSource authentication for OpenAI and Vertex AI providers
  • Adds request-scoped MCP callbacks (elicitation, sampling, OAuth) via a new HandlerScope type, 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.UnmarshalToolArguments instead of raw json.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.Stdout writes in library packages under pkg/
  • Adds lint rule to enforce DOCKER_AGENT_ environment variable prefix, flagging legacy CAGENT_* names
  • Adds lint rule to require atomicfile.Write for marshalled state instead of os.WriteFile
  • Adds lint rule to flag bare &http.Client{} without an explicit Transport
  • Adds lint rule to sync the Toolset schema enum with DefaultToolsetCreators
  • Adds lint rule to enforce state paths go through pkg/paths instead of hard-coded .cagent literals

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_key not being read in the Anthropic and Gemini clients; they now check token_key before 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 StartableToolSet to be the single lifecycle owner for toolset startup, removing parallel state machines in Code Mode
  • Refactors toolset startup coordination into a unified StartToolSets function in pkg/tools
  • Centralizes model provider interfaces (Provider, EmbeddingProvider, BatchEmbeddingProvider, RerankingProvider) into a single pkg/model/provider/contracts package
  • Replaces ProviderRegistry any field with a typed RebuildProviderFunc closure 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 instrumentedBase struct for capability-specific tracing wrappers, removing duplicated method bodies
  • Defers GatewayToolset temp-file creation to Start/Restart so secrets are not written to disk until the subprocess launches
  • Refactors TUI to return explicit UpdateEffects from chat.Update instead of using a routed-timer contract
  • Refactors TUI attention dialog handling into a dedicated attention.go file
  • Introduces tabstate package 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

Full Changelog: v1.139.0...v1.140.0