You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The assistant's engine, tool registry, harness loop, and tool authorization are implemented inline across internal/ai and internal/api, coupled to gin and FlatRun's auth. github.com/whilesmartgo/agents now provides that core as a provider-agnostic, framework-free library. Depend on it and drop the duplicated core, keeping only what is FlatRun-specific.
Checklist
Add github.com/whilesmartgo/agents (pinned) as a dependency.
Replace the internal/ai provider abstraction (Provider, Message, ToolCall, Request, Response) and the OpenAI-compatible client with the library's Engine and engine/openai.
Express the built-in tools (list_deployments, restart_container, run_host_command, and the rest) as agents.Tool values in a Registry, keeping their existing FlatRun implementations.
Drive the session tool loop through agents.Runner, supplying Authorize from the current actor and deployment-write gate and Approve from the awaiting-approval flow.
Keep the FlatRun-specific parts: the gin handlers, the flat-file session store and its per-user scoping, suggested-action parsing, redaction, and the display/hidden transcript projection.
Confirm the assistant behaves identically (auto-run, approval, tool errors, step budget) against the existing tests.
The assistant's engine, tool registry, harness loop, and tool authorization are implemented inline across
internal/aiandinternal/api, coupled to gin and FlatRun's auth.github.com/whilesmartgo/agentsnow provides that core as a provider-agnostic, framework-free library. Depend on it and drop the duplicated core, keeping only what is FlatRun-specific.Checklist
github.com/whilesmartgo/agents(pinned) as a dependency.internal/aiprovider abstraction (Provider,Message,ToolCall,Request,Response) and the OpenAI-compatible client with the library'sEngineandengine/openai.list_deployments,restart_container,run_host_command, and the rest) asagents.Toolvalues in aRegistry, keeping their existing FlatRun implementations.agents.Runner, supplyingAuthorizefrom the current actor and deployment-write gate andApprovefrom the awaiting-approval flow.Related