Skip to content

refactor(ai): Drive the assistant loop through the shared agents runner#187

Merged
nfebe merged 1 commit into
mainfrom
feat/agents-runner-adoption
Jul 21, 2026
Merged

refactor(ai): Drive the assistant loop through the shared agents runner#187
nfebe merged 1 commit into
mainfrom
feat/agents-runner-adoption

Conversation

@nfebe

@nfebe nfebe commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Closes #182.

The assistant's tool loop, step budget, and tool approval move onto the shared whilesmartgo/agents library, so that logic lives in one tested place instead of a hand-rolled loop. The MCP server (#186) already exposes the same tools; both now run on the same runner. Auto-run, per-call approval, suggestion parsing, and the hidden-context split are preserved.

Note: #186 and this branch both touch the agents dependency version, so whichever merges second needs a trivial rebase.

@sourceant

sourceant Bot commented Jul 21, 2026

Copy link
Copy Markdown

Code Review Summary

This PR refactors the AI assistant's execution loop to use the whilesmartgo/agents library. It replaces a manual tool execution loop with a standardized runner, simplifying the API handlers and improving testability. Key features like auto-run, per-call approval, and suggestion parsing are preserved through well-designed adapters.

🚀 Key Improvements

  • Adopted a shared agent runner library, reducing local maintenance of complex tool-loop logic.
  • Implemented CapturingEngine to preserve model metadata across library calls.
  • Simplified ApproveSession handler using the runner's Resume capability.
  • Added comprehensive test coverage for the per-call tool approval workflow.

💡 Minor Suggestions

  • Ensure that fromEngineToolCalls and toEngineToolCalls are consistently available in the internal/ai package to avoid compilation issues in environments with different file splits.

@sourceant sourceant Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review complete. No specific code suggestions were generated. See the overview comment for a summary.

The assistant's tool loop, step budget, and tool approval now run on the
shared agents library instead of a bespoke loop, so this logic lives in
one tested place used by both the assistant and the MCP server. Per-call
tool approval, auto-run, suggestion parsing, and the hidden-context
behavior are preserved.
@nfebe
nfebe force-pushed the feat/agents-runner-adoption branch from 8e124bf to d560b8c Compare July 21, 2026 15:54
@nfebe
nfebe merged commit 1afad20 into main Jul 21, 2026
10 of 11 checks passed
@nfebe
nfebe deleted the feat/agents-runner-adoption branch July 21, 2026 16:20
@nfebe nfebe mentioned this pull request Jul 22, 2026
42 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(ai): Adopt whilesmartgo/agents for the assistant core

1 participant