Skip to content

refactor: consumer-owned interfaces for dialogs, tools, and app services - #4565

Merged
aheritier merged 6 commits into
docker:mainfrom
dgageot:worktree-board-8f78c6884b7b62d5
Oct 9, 2026
Merged

aheritier merged 6 commits into
docker:mainfrom
dgageot:worktree-board-8f78c6884b7b62d5

Conversation

@dgageot

@dgageot dgageot commented Oct 9, 2026

Copy link
Copy Markdown
Member

Several packages depended directly on concrete types from unrelated packages
just to call a handful of methods, which made those consumers harder to test
in isolation and tied their compile-time dependencies to implementation
details they didn't need. This change moves toward consumer-defined
interfaces: each package now declares the narrow contract it actually needs,
and the concrete types satisfy it implicitly.

Six areas are affected. The attention dialogs in pkg/tui/dialog no longer
depend on the app type directly. Five tool expanders
(pkg/tools/a2a, pkg/tools/builtin/openurl, pkg/tools/builtin/fetch,
pkg/tools/builtin/openapi, pkg/tools/builtin/webhook) each define their
own expansion contract instead of importing a shared concrete type. App
title generation in pkg/app now goes through a small interface rather than
a direct dependency. The RAG backend in pkg/tools/builtin/rag and the A2A
streaming sender are likewise behind interfaces owned by the tool package
that uses them. Finally, pkg/runtime narrows the contract it needs for
command resolution.

In every case the refactor is structural only: nil handling, evaluation
timing, and lifecycle ordering are unchanged, and shared domain types and
construction-time dependencies are still passed through as before. Each
change is paired with focused unit tests covering the new interface
boundary, and the full build, test, and lint suite is green for every
commit on the branch.

LookupCommand, ResolveCommand, and executeToolCommands now take the
minimal interface they need instead of the full Runtime, so tests
mock less surface.

Assisted-By: cagent
@dgageot
dgageot requested a review from a team as a code owner October 9, 2026 12:55
@aheritier aheritier added area/a2a Agent-to-Agent protocol, A2A server, inter-agent communication area/core Core agent runtime, session management area/runtime Runtime engine, agent loop execution, tool dispatch, loop detection area/tools For features/issues/fixes related to the usage of built-in and MCP tools area/tui For features/issues/fixes related to the TUI kind/refactor PR refactors code without behavior change labels Oct 9, 2026
@dgageot
dgageot added this pull request to the merge queue Oct 9, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 9, 2026
@aheritier
aheritier added this pull request to the merge queue Oct 9, 2026
Merged via the queue into docker:main with commit cd65d7c Oct 9, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/a2a Agent-to-Agent protocol, A2A server, inter-agent communication area/core Core agent runtime, session management area/runtime Runtime engine, agent loop execution, tool dispatch, loop detection area/tools For features/issues/fixes related to the usage of built-in and MCP tools area/tui For features/issues/fixes related to the TUI kind/refactor PR refactors code without behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants