feat(agent): M4 — bounded tool-use loop + LlmProvider (scripted fake) #10

Merged
charles merged 1 commit from feat/m4-agent into main 2026-06-17 13:57:33 +00:00
Owner

Roadmap M4: the agent engine, deterministically testable with no live LLM.

Changes (geneatrip-agent)

  • LlmProvider trait (one OpenAI-compatible shape for Qwen/Ollama + Kimi/UmansAI); Message/Role/ToolCall/Turn/LlmError.
  • Tool trait + ToolSpec + ToolOutcome (Ok/Err — structured, never fabricated; FR-AGT-14).
  • run(): bounded loop (plan → call tools → observe → repeat) with Budget caps (max_iters/max_tool_calls) ending gracefully with a marked partial (FR-AGT-08/20); unknown/failed tools surfaced as JSON errors, not panics.
  • ScriptedProvider: replays a fixed Turn sequence (tech-spec 12.3).

Verification

  • just qa green. 5 tests: tool-then-finish, tool-call budget cap, empty-script finalize, failing-tool surfaced, unknown-tool safe.

Next: OpenAI-compatible HTTP provider (live Qwen/Kimi) + the trip toolset, then wiring into the trip builder (M6) to replace StubBuilder. Traces: FR-AGT-08/09/10/14/20 · tech-spec 04.

Roadmap **M4**: the agent engine, deterministically testable with **no live LLM**. ## Changes (geneatrip-agent) - `LlmProvider` trait (one OpenAI-compatible shape for Qwen/Ollama + Kimi/UmansAI); `Message`/`Role`/`ToolCall`/`Turn`/`LlmError`. - `Tool` trait + `ToolSpec` + `ToolOutcome` (Ok/Err — structured, never fabricated; FR-AGT-14). - `run()`: bounded loop (plan → call tools → observe → repeat) with `Budget` caps (max_iters/max_tool_calls) ending gracefully with a marked partial (FR-AGT-08/20); unknown/failed tools surfaced as JSON errors, not panics. - `ScriptedProvider`: replays a fixed `Turn` sequence (tech-spec 12.3). ## Verification - `just qa` green. 5 tests: tool-then-finish, tool-call budget cap, empty-script finalize, failing-tool surfaced, unknown-tool safe. Next: OpenAI-compatible HTTP provider (live Qwen/Kimi) + the trip toolset, then wiring into the trip builder (M6) to replace StubBuilder. Traces: FR-AGT-08/09/10/14/20 · tech-spec 04.
feat(agent): M4 — bounded tool-use loop + LlmProvider (scripted fake)
All checks were successful
qa / qa-1 (pull_request) Successful in 56s
qa / qa (pull_request) Successful in 0s
qa / qa-1 (push) Successful in 4m1s
qa / qa (push) Successful in 0s
a9890b5c47
The agent engine, deterministically testable with no live LLM:
- LlmProvider trait (one OpenAI-compatible shape for Qwen/Ollama + Kimi/UmansAI),
  Message/Role/ToolCall/Turn types, LlmError
- Tool trait + ToolSpec + ToolOutcome (Ok/Err — structured, never fabricated)
- run(): the bounded loop — plan → call registered tools → observe → repeat,
  with Budget caps (max_iters, max_tool_calls) ending gracefully with a marked
  partial; unknown/failed tools surfaced as JSON errors, not panics
- ScriptedProvider: replays a fixed Turn sequence (tests / tech-spec 12.3)

5 tests: tool-then-finish, tool-call budget cap, empty-script finalize, failing
tool surfaced, unknown tool safe. just qa green. HTTP providers + trip toolset +
wiring into the trip builder come next (M4b/M6).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/geneatrip!10
No description provided.