Skip to content

feat(agent): add auto-with-judge mode with an LLM judge as the tool approver - #1148

Merged
edenreich merged 21 commits into
mainfrom
fix/issue-1147
Sep 2, 2026
Merged

edenreich merged 21 commits into
mainfrom
fix/issue-1147

Conversation

@inference-gateway-maintainer

@inference-gateway-maintainer inference-gateway-maintainer Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Resolves #1147

Summary

Adds the auto-with-judge agent mode: no human in the loop, but tool calls that would normally prompt a human are decided by one LLM judge call instead of bypassing approval like Auto-Accept. The judge gets the latest non-hidden user message plus the pending tool call and answers a JSON verdict contract; rejections flow through the existing rejection path with the judge's reason appended. Configured via a new .infer/judge.yaml (model/timeout/max_tokens/on_error/prompt, INFER_JUDGE_* env overrides) or tools.safety.approval_behaviour: judge. Disabled by default - standard/plan/auto behavior is unchanged.

Changes

  • config/judge.go: JudgeConfig, defaults, LoadJudge, Validate (on_error deny|allow), ResolveModel falling back to agent.model; wired in cmd/runtime/config.go next to LoadHooks with INFER_JUDGE_* env overrides.
  • config/config.go: ApprovalBehaviourJudge value accepted by ApprovalBehaviourFor/Validate/ResolveApprovalDelivery (judge is never downgraded to block for lack of a broker); JudgeRequired() + fail-fast validation when the judge is selected with no resolvable model.
  • internal/agent/domain: AgentModeAutoWithJudge (ParseAgentMode/String/DisplayName "Auto+Judge", AllowedlistKey() returns "standard"), JudgeVerdict + ParseJudgeVerdict (strips fences/prose, enforces the JSON contract), JudgeApprover port, JudgeVerdictChatEvent.
  • internal/agent/judge.go: LLMJudge - one no-tools GenerateContent shaped like GenerateLLMSummary (SkipMCP, own timeout, bounded max_tokens); on_error deny (default, fail closed like the no-approver block path) or allow.
  • Approval flow: requestToolApproval routes to requestJudgeApproval (returns (false, judgeReason, nil)); createRejectionEntry/buildRejectionEntry append the judge reason; ApprovalDelivery forces judge in the mode. Allow-listed commands still pass for free (AllowedlistKey() = "standard").
  • Observability: judge_verdict on --format json, ag-ui custom event, text/stderr line for rejections, and the hidden debug channel via streamevent.EmitDebugEvent.
  • TUI: JudgeVerdictChatEvent flashes "Action rejected by judge policy: " via SetStatusEvent.
  • Headless: --mode flag (validated via ParseAgentMode; INFER_AGENT_MODE, then subagent-inherited mode) with judge-model fail-fast before the gateway/agent starts.
  • Mode fan-out: Shift+Tab cycle after Auto-Accept, mode indicator, reminders guidance + guidance-key validation, extension bridge reports the canonical mode key (protocol doc updated).
  • Tests: judge rejection entry carries reason; approving_tools stubs updated to the three-value approval signature.
  • Tests (finalisation): config/judge_test.go (defaults, LoadJudge file handling, Effective defaults, ResolveModel, Validate), config behaviour-value tests (judge accepted by ApprovalBehaviourFor/Validate/ResolveApprovalDelivery, JudgeRequired + model fail-fast), approval_policy_test.go auto-with-judge cases (keeps standard rules, allow-listed bash never reaches the judge), internal/agent/domain/judge_test.go (ParseJudgeVerdict contract: fences, prose, invalid decisions), internal/agent/judge_test.go (LLMJudge prompt shaping, on_error deny/allow, unparseable output denies, latestUserIntent filtering).
  • Docs: new docs/judge-mode.md; docs/configuration-reference.md (approval_behaviour judge bullet + Judge Approval (judge.yaml) section with INFER_JUDGE_* overrides); docs/commands-reference.md (four-way Shift+Tab cycle, Auto+Judge mode entry, headless --mode); docs/plan-mode.md + README mode cycle/index updated. (shortcuts-guide.md covers only /shortcuts - the Shift+Tab docs live in commands-reference.md.)

Notes for review

  • Optional e2e (INFER_GATEWAY_MOCK canned judge verdict) skipped: the judge decision path is covered by unit tests, and a scenario would have to match the judge prompt text - fragile for little gain.
  • The two cmd/runtime/config_pointer_env_test.go tests (TestPointerDefaultsSurviveWithoutEnvOverride, TestPointerOptionPrecedence) fail in Actions-runner sandboxes identically on main - pre-existing and environmental, not touched by this PR.

Resolves #1147

Review follow-ups (pushed on this branch)

  • Mode-change guidance, subagent inheritance, and chat telemetry now key by ModeKey(); before this, auto-with-judge collapsed to standard in all three places and a judge-mode parent spawned children that blocked on every gated tool.
  • JudgeRequired() only reads approval_behaviour; the headless runner fail-fasts on --mode / INFER_AGENT_MODE itself.
  • The judge prompt is split into a system_prompt (instructions, with a data-not-instructions rule) and a tagged user message; new INFER_JUDGE_SYSTEM_PROMPT override.
  • judge.gateway_url / INFER_JUDGE_GATEWAY_URL gives the judge its own client, so a real judge can approve a mock-driven session.
  • A judge rejection is a failed tool result (rejected by judge: <model>: <reason>) and the turn continues; only a human rejection ends the turn. Previously the run ended after the first judge rejection and the driver never saw the reason.
  • The TUI now routes JudgeVerdictChatEvent through isDomainEvent and re-arms the chat listener; before this the TUI dropped every event after the first verdict and the tool card stayed "queued". The collapsed failed card shows the error text.
  • The judge model is shown in the mode indicator, the flash, the verdict events, and the rejected tool result. Judge token usage is recorded in session totals and telemetry. judge_request is emitted on the debug channel with the rendered prompt.
  • Tests: e2e judge scenario (mock judge, asserts the driver's follow-up), listener re-arm, event routing, four-way mode cycle, formatter, rejection entries.

Docs ticket: inference-gateway/docs#633 (updated with these follow-ups). Refactors spun out of the review: #1151, #1152, #1153, #1154, #1155.

tools.safety.approval_behaviour gains a judge value decided by an LLM judge; judge.yaml (model/timeout/max_tokens/on_error/prompt) loads next to hooks.yaml with INFER_JUDGE_* env overrides, and selecting the judge with no resolvable model fails fast at config validation.
requestToolApproval routes to requestJudgeApproval when the mode is auto-with-judge or approval_behaviour=judge: one no-tools GenerateContent call (judge.yaml model/timeout/max_tokens/on_error/prompt) over the latest non-hidden user message plus the pending tool call, verdict parsed via ParseJudgeVerdict, rejections flow through the existing rejection path with the judge reason appended, a judge_verdict chat event drives the TUI flash / headless stderr / json+ag-ui output and the debug mirror.

headless gains --mode (validated via ParseAgentMode, env INFER_AGENT_MODE, subagent fallback) with fail-fast validation for an unresolvable judge model; the extension bridge now reports the canonical mode key.
@edenreich

Copy link
Copy Markdown
Contributor

@infer Can you finalise the work on this PR? Make it ready for review. use /ponytail:ponytail /go /go-concurrency /bubbles-v2 /lipgloss-v2 /bubbletea-v2

@inference-gateway-maintainer

inference-gateway-maintainer Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor Author

Model: ollama_cloud/glm-5.3-flash · View Job

Todos

  • Survey current diff and judge implementation state
  • Add config/judge_test.go and config behaviour-value tests
  • Add approval_policy_test.go judge-mode case (standard rules, zero judge calls on allow-listed)
  • Docs: configuration-reference.md, commands-reference.md, plan-mode.md, README, new judge-mode.md
  • Judge checks: unit tests for ParseJudgeVerdict + LLMJudge on_error (replaced optional e2e scenario as the cheaper, more robust check)
  • Run full checks (go vet + go test -race -tags purego) and fix failures
  • Update PR body, mark ready for review, close memory loop

Pull Request

#1148

✅ Infer Result: Success

All checks pass except test, which is still pending server-side (I ran the equivalent suite locally with -race -tags purego - green except the two documented pre-existing env failures). Let me close out the todo list and summarize.

PR #1148 is finalised and ready for review. Here is what landed in this session (4 commits pushed to fix/issue-1147):

Tests (closing the PR's remaining-work checklist)

  • test(config) (f8968e1): new config/judge_test.go - defaults, LoadJudge (missing file -> defaults, parsed file, invalid YAML, partial-file + Effective() defaults), ResolveModel fallback, Validate; plus config/approval_test.go behaviour-value tests: judge accepted by ApprovalBehaviourFor/Validate/ResolveApprovalDelivery (never downgraded to block, even in CI), JudgeRequired() (behaviour value and INFER_AGENT_MODE, case/whitespace tolerant), and the judge-model fail-fast validation.
  • test(agent) (f122b70): approval_policy_test.go auto-with-judge cases - the mode keeps standard approval rules (gated tools still gate, disallowed bash routes to the judge) and allow-listed bash bypasses entirely, so it never makes a judge call; plus a domain test for the new mode's values (AllowedlistKey() == "standard", ModeKey(), display name, roundtrip).
  • test(agent) (452869e): the previously untested judge logic - internal/agent/domain/judge_test.go for ParseJudgeVerdict (fences, surrounding prose, invalid decisions/JSON) and internal/agent/judge_test.go for LLMJudge (prompt shaping of {intent}/{action}, provider/model split, on_error deny/allow, unparseable output denies, latestUserIntent filtering).

Docs (c18395c)

  • New docs/judge-mode.md: what the judge decides, the verdict contract, judge.yaml schema with INFER_JUDGE_* overrides, on_error semantics, model resolution/fail-fast, judge as approval_behaviour without the mode, observability.
  • docs/configuration-reference.md: judge bullet under approval_behaviour + a new "Judge Approval (judge.yaml)" section.
  • docs/commands-reference.md: four-way Shift+Tab cycle, Auto+Judge mode entry, headless --mode flag with fail-fast note.
  • docs/plan-mode.md cycle diagram and README modes index updated.

Two deliberate calls, noted for reviewers:

  • The optional INFER_GATEWAY_MOCK canned-verdict e2e was skipped: the judge decision path is now unit-covered, and a scenario would have to regex-match the judge prompt text - fragile for little gain.
  • The old PR body named docs/shortcuts-guide.md, but that file documents only the /shortcuts system; the agent-mode docs live in commands-reference.md, so they went there instead.

Checks: go vet -tags purego clean, golangci-lint 0 issues, markdownlint clean on every commit, and go test -race -tags purego ./... green except the two pre-existing cmd/runtime/config_pointer_env_test.go failures that fail identically on main in Actions-runner sandboxes (environmental, untouched by this PR). CI on the PR: all checks pass except the test job, which was still running server-side at last check. The PR body is updated with all of this, and the PR is marked ready for review.

Model: ollama_cloud/glm-5.3-flash · Exit Code: 0 · Duration: 19m 58s

Tokens: 11,391,944 in · 42,587 out · 11,434,531 total (93 requests)

Tool calls: 117 total · 100% success rate

Traces
Session: 1788354067-7c2c2bcf

session (headless, success)                                                 19m50s
├── chat ollama_cloud/glm-5.3-flash                                           3.9s
│   ╰── POST /v1/chat/completions [inference-gateway]                         3.9s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     3.9s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               3.9s
│               ╰── POST /v1/chat/completions [inference-gateway]             3.9s [error: *errors.errorString]
├── execute_tool Memory call_q4lbd9xp                                        123µs
├── execute_tool Read call_khkgccmq                                          143µs
├── execute_tool Memory call_dj8ix2lt                                        101µs
├── chat ollama_cloud/glm-5.3-flash                                           6.2s
│   ╰── POST /v1/chat/completions [inference-gateway]                         6.2s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     6.2s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               6.2s
│               ╰── POST /v1/chat/completions [inference-gateway]             6.2s [error: *errors.errorString]
├── execute_tool Read call_x0k9ufki                                          270µs
├── execute_tool TodoWrite call_32xpkiah                                      88µs
├── chat ollama_cloud/glm-5.3-flash                                           2.9s
│   ╰── POST /v1/chat/completions [inference-gateway]                         2.9s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     2.9s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               2.9s
│               ╰── POST /v1/chat/completions [inference-gateway]             2.9s [error: *errors.errorString]
├── execute_tool Read call_kh8wp0ku                                          166µs
├── execute_tool Read call_pdmvnc58                                          439µs
├── execute_tool Read call_74bkaibz                                          143µs
├── chat ollama_cloud/glm-5.3-flash                                           6.2s
│   ╰── POST /v1/chat/completions [inference-gateway]                         6.2s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     6.2s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               6.2s
│               ╰── POST /v1/chat/completions [inference-gateway]             6.2s [error: *errors.errorString]
├── execute_tool Read call_vkzfz328                                          172µs
├── execute_tool Read call_yn99h36e                                          172µs
├── execute_tool Read call_xwfzhxyn                                          215µs
├── chat ollama_cloud/glm-5.3-flash                                           3.4s
│   ╰── POST /v1/chat/completions [inference-gateway]                         3.4s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     3.4s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               3.4s
│               ╰── POST /v1/chat/completions [inference-gateway]             3.4s [error: *errors.errorString]
├── execute_tool Bash call_gzzouuqb                                            3ms
├── execute_tool Grep call_e1u5072h                                            3ms
├── chat ollama_cloud/glm-5.3-flash                                           2.5s
│   ╰── POST /v1/chat/completions [inference-gateway]                         2.5s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     2.5s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               2.5s
│               ╰── POST /v1/chat/completions [inference-gateway]             2.5s [error: *errors.errorString]
├── execute_tool Read call_quz8ceze                                          187µs
├── execute_tool Read call_49v28bhe                                          232µs
├── chat ollama_cloud/glm-5.3-flash                                           7.4s
│   ╰── POST /v1/chat/completions [inference-gateway]                         7.4s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     7.3s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               7.3s
│               ╰── POST /v1/chat/completions [inference-gateway]             7.3s [error: *errors.errorString]
├── execute_tool Grep call_2k3a4g9v                                            2ms
├── execute_tool Read call_q8t3wgma                                          216µs
├── chat ollama_cloud/glm-5.3-flash                                           8.9s
│   ╰── POST /v1/chat/completions [inference-gateway]                         8.9s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     8.9s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               8.9s
│               ╰── POST /v1/chat/completions [inference-gateway]             8.9s [error: *errors.errorString]
├── execute_tool Read call_blrr0gl4                                          399µs
├── execute_tool Read call_24b0vx3z                                          382µs
├── chat ollama_cloud/glm-5.3-flash                                           7.1s
│   ╰── POST /v1/chat/completions [inference-gateway]                         7.1s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     7.1s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               7.1s
│               ╰── POST /v1/chat/completions [inference-gateway]             7.1s [error: *errors.errorString]
├── execute_tool Grep call_8nycogr0                                           17ms
├── execute_tool TodoWrite call_svryct4d                                      52µs
├── chat ollama_cloud/glm-5.3-flash                                           3.0s
│   ╰── POST /v1/chat/completions [inference-gateway]                         3.0s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     3.0s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               3.0s
│               ╰── POST /v1/chat/completions [inference-gateway]             3.0s [error: *errors.errorString]
├── execute_tool Read call_c6yjkbui                                          170µs
├── chat ollama_cloud/glm-5.3-flash                                           2.6s
│   ╰── POST /v1/chat/completions [inference-gateway]                         2.6s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     2.6s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               2.6s
│               ╰── POST /v1/chat/completions [inference-gateway]             2.6s [error: *errors.errorString]
├── execute_tool Read call_u1cumxr7                                          164µs
├── chat ollama_cloud/glm-5.3-flash                                           3.7s
│   ╰── POST /v1/chat/completions [inference-gateway]                         3.7s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     3.6s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               3.6s
│               ╰── POST /v1/chat/completions [inference-gateway]             3.6s [error: *errors.errorString]
├── execute_tool Read call_mppsa342                                          178µs
├── chat ollama_cloud/glm-5.3-flash                                          11.4s
│   ╰── POST /v1/chat/completions [inference-gateway]                        11.4s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]    11.4s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]              11.4s
│               ╰── POST /v1/chat/completions [inference-gateway]            11.4s [error: *errors.errorString]
├── execute_tool Write call_u6zi4aai                                         881µs
├── chat ollama_cloud/glm-5.3-flash                                           8.1s
│   ╰── POST /v1/chat/completions [inference-gateway]                         8.1s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     8.1s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               8.1s
│               ╰── POST /v1/chat/completions [inference-gateway]             8.1s [error: *errors.errorString]
├── execute_tool MultiEdit call_2oiamuz4                                     346µs
├── chat ollama_cloud/glm-5.3-flash                                           4.4s
│   ╰── POST /v1/chat/completions [inference-gateway]                         4.4s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     4.4s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               4.4s
│               ╰── POST /v1/chat/completions [inference-gateway]             4.4s [error: *errors.errorString]
├── execute_tool Bash call_dqnzxxkt                                          22.7s
├── chat ollama_cloud/glm-5.3-flash                                           2.0s
│   ╰── POST /v1/chat/completions [inference-gateway]                         2.0s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     2.0s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               2.0s
│               ╰── POST /v1/chat/completions [inference-gateway]             2.0s [error: *errors.errorString]
├── execute_tool Bash call_yvszpuib                                           67ms
├── chat ollama_cloud/glm-5.3-flash                                           1.8s
│   ╰── POST /v1/chat/completions [inference-gateway]                         1.8s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     1.7s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               1.7s
│               ╰── POST /v1/chat/completions [inference-gateway]             1.7s [error: *errors.errorString]
├── chat ollama_cloud/glm-5.3-flash                                           2.3s
│   ╰── POST /v1/chat/completions [inference-gateway]                         2.3s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     2.3s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               2.3s
│               ╰── POST /v1/chat/completions [inference-gateway]             2.3s [error: *errors.errorString]
├── execute_tool Bash call_rd6yles4                                            8ms
├── chat ollama_cloud/glm-5.3-flash                                           2.2s
│   ╰── POST /v1/chat/completions [inference-gateway]                         2.1s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     2.1s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               2.1s
│               ╰── POST /v1/chat/completions [inference-gateway]             2.1s [error: *errors.errorString]
├── execute_tool Bash call_uwpq89j8                                          1m49s
├── chat ollama_cloud/glm-5.3-flash                                           2.6s
│   ╰── POST /v1/chat/completions [inference-gateway]                         2.6s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     2.6s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               2.6s
│               ╰── POST /v1/chat/completions [inference-gateway]             2.6s [error: *errors.errorString]
├── execute_tool Bash call_wsi7dkyi                                           1.5s
├── chat ollama_cloud/glm-5.3-flash                                           7.0s
│   ╰── POST /v1/chat/completions [inference-gateway]                         6.9s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     6.9s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               6.9s
│               ╰── POST /v1/chat/completions [inference-gateway]             6.9s [error: *errors.errorString]
├── execute_tool Grep call_69nav0rm                                          415µs
├── execute_tool TodoWrite call_mn1vp0s6                                      78µs
├── chat ollama_cloud/glm-5.3-flash                                           4.0s
│   ╰── POST /v1/chat/completions [inference-gateway]                         4.0s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     4.0s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               4.0s
│               ╰── POST /v1/chat/completions [inference-gateway]             4.0s [error: *errors.errorString]
├── execute_tool Read call_ewnt25j6                                          183µs
├── chat ollama_cloud/glm-5.3-flash                                           9.4s
│   ╰── POST /v1/chat/completions [inference-gateway]                         9.3s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     9.3s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               9.3s
│               ╰── POST /v1/chat/completions [inference-gateway]             9.3s [error: *errors.errorString]
├── execute_tool Edit call_8z02r0qg                                          301µs
├── execute_tool Edit call_iq4n6j5b                                          358µs
├── chat ollama_cloud/glm-5.3-flash                                           3.7s
│   ╰── POST /v1/chat/completions [inference-gateway]                         3.7s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     3.7s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               3.7s
│               ╰── POST /v1/chat/completions [inference-gateway]             3.7s [error: *errors.errorString]
├── execute_tool Bash call_v235bm6c                                          30.9s
├── chat ollama_cloud/glm-5.3-flash                                           9.4s
│   ╰── POST /v1/chat/completions [inference-gateway]                         9.3s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     9.3s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               9.3s
│               ╰── POST /v1/chat/completions [inference-gateway]             9.3s [error: *errors.errorString]
├── execute_tool Bash call_z6tiodik                                          487ms
├── chat ollama_cloud/glm-5.3-flash                                           3.1s
│   ╰── POST /v1/chat/completions [inference-gateway]                         3.0s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     3.0s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               3.0s
│               ╰── POST /v1/chat/completions [inference-gateway]             3.0s [error: *errors.errorString]
├── execute_tool Bash call_s9cmf88c                                          115ms
├── chat ollama_cloud/glm-5.3-flash                                           2.1s
│   ╰── POST /v1/chat/completions [inference-gateway]                         2.1s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     2.0s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               2.0s
│               ╰── POST /v1/chat/completions [inference-gateway]             2.0s [error: *errors.errorString]
├── execute_tool Bash call_o0w7xwvz                                            8ms
├── chat ollama_cloud/glm-5.3-flash                                           2.3s
│   ╰── POST /v1/chat/completions [inference-gateway]                         2.2s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     2.2s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               2.2s
│               ╰── POST /v1/chat/completions [inference-gateway]             2.2s [error: *errors.errorString]
├── execute_tool Bash call_yims2dk6                                          1m17s
├── chat ollama_cloud/glm-5.3-flash                                           3.1s
│   ╰── POST /v1/chat/completions [inference-gateway]                         3.1s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     3.1s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               3.1s
│               ╰── POST /v1/chat/completions [inference-gateway]             3.1s [error: *errors.errorString]
├── execute_tool Bash call_frpdm91l                                           1.6s
├── chat ollama_cloud/glm-5.3-flash                                           5.8s
│   ╰── POST /v1/chat/completions [inference-gateway]                         5.8s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     5.8s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               5.8s
│               ╰── POST /v1/chat/completions [inference-gateway]             5.8s [error: *errors.errorString]
├── execute_tool TodoWrite call_1zgkrhvn                                      53µs
├── execute_tool Grep call_rs730vo6                                            2ms
├── chat ollama_cloud/glm-5.3-flash                                           3.7s
│   ╰── POST /v1/chat/completions [inference-gateway]                         3.7s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     3.7s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               3.7s
│               ╰── POST /v1/chat/completions [inference-gateway]             3.7s [error: *errors.errorString]
├── execute_tool Read call_ajersngp                                          211µs
├── execute_tool Read call_tquqc452                                          258µs
├── chat ollama_cloud/glm-5.3-flash                                          10.8s
│   ╰── POST /v1/chat/completions [inference-gateway]                        10.8s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]    10.7s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]              10.7s
│               ╰── POST /v1/chat/completions [inference-gateway]            10.7s [error: *errors.errorString]
├── execute_tool Read call_6zq2oxme                                          177µs
├── execute_tool Grep call_nv1f3mri                                            1ms
├── chat ollama_cloud/glm-5.3-flash                                           3.7s
│   ╰── POST /v1/chat/completions [inference-gateway]                         3.7s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     3.7s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               3.7s
│               ╰── POST /v1/chat/completions [inference-gateway]             3.7s [error: *errors.errorString]
├── chat ollama_cloud/glm-5.3-flash                                           4.2s
│   ╰── POST /v1/chat/completions [inference-gateway]                         4.2s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     4.2s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               4.2s
│               ╰── POST /v1/chat/completions [inference-gateway]             4.2s [error: *errors.errorString]
├── execute_tool Grep call_7lux441z                                            1ms
├── chat ollama_cloud/glm-5.3-flash                                           5.3s
│   ╰── POST /v1/chat/completions [inference-gateway]                         5.3s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     5.3s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               5.3s
│               ╰── POST /v1/chat/completions [inference-gateway]             5.3s [error: *errors.errorString]
├── execute_tool Grep call_x2e49tvd                                           12ms
├── chat ollama_cloud/glm-5.3-flash                                           7.1s
│   ╰── POST /v1/chat/completions [inference-gateway]                         7.1s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     7.1s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               7.1s
│               ╰── POST /v1/chat/completions [inference-gateway]             7.1s [error: *errors.errorString]
├── execute_tool Read call_90gtw2w2                                          172µs
├── execute_tool Read call_ljfrzjx4                                          260µs
├── chat ollama_cloud/glm-5.3-flash                                          11.8s
│   ╰── POST /v1/chat/completions [inference-gateway]                        11.8s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]    11.7s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]              11.7s
│               ╰── POST /v1/chat/completions [inference-gateway]            11.7s [error: *errors.errorString]
├── execute_tool Grep call_dw1pinm8                                            1ms
├── execute_tool Grep call_drim8u06                                            2ms
├── chat ollama_cloud/glm-5.3-flash                                           3.7s
│   ╰── POST /v1/chat/completions [inference-gateway]                         3.6s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     3.6s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               3.6s
│               ╰── POST /v1/chat/completions [inference-gateway]             3.6s [error: *errors.errorString]
├── execute_tool Grep call_w3pbotl7                                           21ms
├── chat ollama_cloud/glm-5.3-flash                                           3.2s
│   ╰── POST /v1/chat/completions [inference-gateway]                         3.1s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     3.1s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               3.1s
│               ╰── POST /v1/chat/completions [inference-gateway]             3.1s [error: *errors.errorString]
├── execute_tool Read call_jogo83vd                                          137µs
├── chat ollama_cloud/glm-5.3-flash                                           4.1s
│   ╰── POST /v1/chat/completions [inference-gateway]                         4.1s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     4.1s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               4.1s
│               ╰── POST /v1/chat/completions [inference-gateway]             4.1s [error: *errors.errorString]
├── execute_tool Grep call_or7odtr3                                            1ms
├── execute_tool Read call_d0vi9224                                          162µs
├── chat ollama_cloud/glm-5.3-flash                                           5.7s
│   ╰── POST /v1/chat/completions [inference-gateway]                         5.7s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     5.7s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               5.7s
│               ╰── POST /v1/chat/completions [inference-gateway]             5.7s [error: *errors.errorString]
├── execute_tool Read call_vs12ka2r                                          141µs
├── chat ollama_cloud/glm-5.3-flash                                           6.9s
│   ╰── POST /v1/chat/completions [inference-gateway]                         6.8s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     6.8s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               6.8s
│               ╰── POST /v1/chat/completions [inference-gateway]             6.8s [error: *errors.errorString]
├── execute_tool Grep call_wiudhrb9                                            1ms
├── chat ollama_cloud/glm-5.3-flash                                          11.5s
│   ╰── POST /v1/chat/completions [inference-gateway]                        11.4s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]    11.4s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]              11.4s
│               ╰── POST /v1/chat/completions [inference-gateway]            11.4s [error: *errors.errorString]
├── execute_tool Grep call_57lm3efn                                            1ms
├── chat ollama_cloud/glm-5.3-flash                                          16.0s
│   ╰── POST /v1/chat/completions [inference-gateway]                        16.0s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]    15.9s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]              15.9s
│               ╰── POST /v1/chat/completions [inference-gateway]            15.9s [error: *errors.errorString]
├── execute_tool Write call_i4fjez88                                         828µs
├── chat ollama_cloud/glm-5.3-flash                                           4.6s
│   ╰── POST /v1/chat/completions [inference-gateway]                         4.6s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     4.5s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               4.5s
│               ╰── POST /v1/chat/completions [inference-gateway]             4.5s [error: *errors.errorString]
├── execute_tool Grep call_dx73nv8t                                          478µs
├── chat ollama_cloud/glm-5.3-flash                                           4.6s
│   ╰── POST /v1/chat/completions [inference-gateway]                         4.6s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     4.6s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               4.6s
│               ╰── POST /v1/chat/completions [inference-gateway]             4.6s [error: *errors.errorString]
├── execute_tool Read call_h9haa60m                                          284µs
├── execute_tool Read call_q1entapc                                          144µs
├── chat ollama_cloud/glm-5.3-flash                                          10.3s
│   ╰── POST /v1/chat/completions [inference-gateway]                        10.3s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]    10.2s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]              10.2s
│               ╰── POST /v1/chat/completions [inference-gateway]            10.2s [error: *errors.errorString]
├── execute_tool MultiEdit call_0ge4125a                                     870µs
├── chat ollama_cloud/glm-5.3-flash                                           7.1s
│   ╰── POST /v1/chat/completions [inference-gateway]                         7.1s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     7.0s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               7.0s
│               ╰── POST /v1/chat/completions [inference-gateway]             7.0s [error: *errors.errorString]
├── execute_tool MultiEdit call_h8t9h6jk                                     466µs
├── chat ollama_cloud/glm-5.3-flash                                           3.3s
│   ╰── POST /v1/chat/completions [inference-gateway]                         3.3s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     3.3s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               3.3s
│               ╰── POST /v1/chat/completions [inference-gateway]             3.3s [error: *errors.errorString]
├── execute_tool Edit call_ongc1y76                                          308µs
├── execute_tool Read call_xptdtmn3                                          167µs
├── chat ollama_cloud/glm-5.3-flash                                           3.4s
│   ╰── POST /v1/chat/completions [inference-gateway]                         3.4s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     3.4s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               3.4s
│               ╰── POST /v1/chat/completions [inference-gateway]             3.4s [error: *errors.errorString]
├── execute_tool Edit call_kkjcgzui                                            1ms
├── chat ollama_cloud/glm-5.3-flash                                           4.6s
│   ╰── POST /v1/chat/completions [inference-gateway]                         4.6s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     4.5s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               4.5s
│               ╰── POST /v1/chat/completions [inference-gateway]             4.5s [error: *errors.errorString]
├── execute_tool Bash call_htsx4cg4                                          552ms [error: tool_error]
├── chat ollama_cloud/glm-5.3-flash                                          13.9s
│   ╰── POST /v1/chat/completions [inference-gateway]                        13.8s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]    13.8s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]              13.8s
│               ╰── POST /v1/chat/completions [inference-gateway]            13.8s [error: *errors.errorString]
├── execute_tool Write call_77jqdd93                                         783µs
├── chat ollama_cloud/glm-5.3-flash                                           2.9s
│   ╰── POST /v1/chat/completions [inference-gateway]                         2.8s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     2.8s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               2.8s
│               ╰── POST /v1/chat/completions [inference-gateway]             2.8s [error: *errors.errorString]
├── execute_tool Bash call_br95mtxa                                          243ms [error: tool_error]
├── chat ollama_cloud/glm-5.3-flash                                           4.0s
│   ╰── POST /v1/chat/completions [inference-gateway]                         3.9s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     3.9s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               3.9s
│               ╰── POST /v1/chat/completions [inference-gateway]             3.9s [error: *errors.errorString]
├── chat ollama_cloud/glm-5.3-flash                                           3.7s
│   ╰── POST /v1/chat/completions [inference-gateway]                         3.7s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     3.6s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               3.6s
│               ╰── POST /v1/chat/completions [inference-gateway]             3.6s [error: *errors.errorString]
├── execute_tool Bash call_o6usvbj2                                          254ms
├── chat ollama_cloud/glm-5.3-flash                                           2.8s
│   ╰── POST /v1/chat/completions [inference-gateway]                         2.8s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     2.7s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               2.7s
│               ╰── POST /v1/chat/completions [inference-gateway]             2.7s [error: *errors.errorString]
├── execute_tool Bash call_s6zttyf5                                          540ms
├── chat ollama_cloud/glm-5.3-flash                                           3.7s
│   ╰── POST /v1/chat/completions [inference-gateway]                         3.6s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     3.6s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               3.6s
│               ╰── POST /v1/chat/completions [inference-gateway]             3.6s [error: *errors.errorString]
├── execute_tool Bash call_se7kxzwe                                           11ms
├── chat ollama_cloud/glm-5.3-flash                                           3.0s
│   ╰── POST /v1/chat/completions [inference-gateway]                         3.0s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     2.9s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               2.9s
│               ╰── POST /v1/chat/completions [inference-gateway]             2.9s [error: *errors.errorString]
├── execute_tool Bash call_r7etm2ae                                           5.2s
├── chat ollama_cloud/glm-5.3-flash                                           5.6s
│   ╰── POST /v1/chat/completions [inference-gateway]                         5.6s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     5.6s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               5.6s
│               ╰── POST /v1/chat/completions [inference-gateway]             5.6s [error: *errors.errorString]
├── execute_tool Bash call_ixcznh4f                                           1.7s
├── chat ollama_cloud/glm-5.3-flash                                           4.9s
│   ╰── POST /v1/chat/completions [inference-gateway]                         4.8s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     4.8s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               4.8s
│               ╰── POST /v1/chat/completions [inference-gateway]             4.8s [error: *errors.errorString]
├── execute_tool TodoWrite call_io95eff0                                      83µs
├── execute_tool Read call_fyy48ce5                                          213µs
├── chat ollama_cloud/glm-5.3-flash                                           7.6s
│   ╰── POST /v1/chat/completions [inference-gateway]                         7.6s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     7.5s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               7.5s
│               ╰── POST /v1/chat/completions [inference-gateway]             7.5s [error: *errors.errorString]
├── execute_tool Grep call_m7wxism5                                           86ms
├── chat ollama_cloud/glm-5.3-flash                                           8.2s
│   ╰── POST /v1/chat/completions [inference-gateway]                         8.2s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     8.2s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               8.2s
│               ╰── POST /v1/chat/completions [inference-gateway]             8.2s [error: *errors.errorString]
├── execute_tool Grep call_w7ihoskd                                           54ms
├── chat ollama_cloud/glm-5.3-flash                                          11.9s
│   ╰── POST /v1/chat/completions [inference-gateway]                        11.9s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]    11.9s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]              11.9s
│               ╰── POST /v1/chat/completions [inference-gateway]            11.9s [error: *errors.errorString]
├── execute_tool Grep call_z2j4krc3                                           81ms
├── chat ollama_cloud/glm-5.3-flash                                           3.4s
│   ╰── POST /v1/chat/completions [inference-gateway]                         3.4s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     3.4s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               3.4s
│               ╰── POST /v1/chat/completions [inference-gateway]             3.4s [error: *errors.errorString]
├── execute_tool Read call_dnjmyjsg                                          174µs
├── chat ollama_cloud/glm-5.3-flash                                           8.0s
│   ╰── POST /v1/chat/completions [inference-gateway]                         8.0s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     7.9s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               7.9s
│               ╰── POST /v1/chat/completions [inference-gateway]             7.9s [error: *errors.errorString]
├── execute_tool Grep call_rjiaenvp                                            2ms
├── chat ollama_cloud/glm-5.3-flash                                           6.2s
│   ╰── POST /v1/chat/completions [inference-gateway]                         6.1s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     6.1s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               6.1s
│               ╰── POST /v1/chat/completions [inference-gateway]             6.1s
├── execute_tool Grep call_5yluwm9o                                           81ms
├── chat ollama_cloud/glm-5.3-flash                                           4.1s
│   ╰── POST /v1/chat/completions [inference-gateway]                         4.1s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     4.1s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               4.1s
│               ╰── POST /v1/chat/completions [inference-gateway]             4.1s [error: *errors.errorString]
├── execute_tool Grep call_n0lkaj09                                           79ms
├── chat ollama_cloud/glm-5.3-flash                                           3.1s
│   ╰── POST /v1/chat/completions [inference-gateway]                         3.0s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     3.0s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               3.0s
│               ╰── POST /v1/chat/completions [inference-gateway]             3.0s [error: *errors.errorString]
├── execute_tool Read call_ucv4uq5y                                          131µs [error: tool_error]
├── chat ollama_cloud/glm-5.3-flash                                           4.2s
│   ╰── POST /v1/chat/completions [inference-gateway]                         4.2s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     4.1s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               4.1s
│               ╰── POST /v1/chat/completions [inference-gateway]             4.1s [error: *errors.errorString]
├── execute_tool Bash call_deyezadx                                            8ms
├── chat ollama_cloud/glm-5.3-flash                                           2.8s
│   ╰── POST /v1/chat/completions [inference-gateway]                         2.8s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     2.8s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               2.8s
│               ╰── POST /v1/chat/completions [inference-gateway]             2.8s [error: *errors.errorString]
├── execute_tool Read call_09v7yecu                                          150µs
├── chat ollama_cloud/glm-5.3-flash                                          25.9s
│   ╰── POST /v1/chat/completions [inference-gateway]                        25.8s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]    25.8s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]              25.8s
│               ╰── POST /v1/chat/completions [inference-gateway]            25.8s [error: *errors.errorString]
├── execute_tool Write call_359yl72f                                         824µs
├── chat ollama_cloud/glm-5.3-flash                                           9.6s
│   ╰── POST /v1/chat/completions [inference-gateway]                         9.5s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     9.5s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               9.5s
│               ╰── POST /v1/chat/completions [inference-gateway]             9.5s [error: *errors.errorString]
├── execute_tool Write call_8tmb1oa2                                         819µs
├── chat ollama_cloud/glm-5.3-flash                                           3.4s
│   ╰── POST /v1/chat/completions [inference-gateway]                         3.3s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     3.3s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               3.3s
│               ╰── POST /v1/chat/completions [inference-gateway]             3.3s [error: *errors.errorString]
├── execute_tool Bash call_ycz58qhc                                           2.6s
├── chat ollama_cloud/glm-5.3-flash                                           4.5s
│   ╰── POST /v1/chat/completions [inference-gateway]                         4.5s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     4.5s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               4.5s
│               ╰── POST /v1/chat/completions [inference-gateway]             4.5s [error: *errors.errorString]
├── execute_tool Bash call_7pixiro8                                          492ms
├── chat ollama_cloud/glm-5.3-flash                                           3.6s
│   ╰── POST /v1/chat/completions [inference-gateway]                         3.6s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     3.5s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               3.5s
│               ╰── POST /v1/chat/completions [inference-gateway]             3.5s [error: *errors.errorString]
├── execute_tool Bash call_xa6retzf                                          115ms
├── chat ollama_cloud/glm-5.3-flash                                           3.7s
│   ╰── POST /v1/chat/completions [inference-gateway]                         3.7s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     3.6s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               3.6s
│               ╰── POST /v1/chat/completions [inference-gateway]             3.6s
├── execute_tool Bash call_wluvv2f4                                            8ms
├── chat ollama_cloud/glm-5.3-flash                                           2.9s
│   ╰── POST /v1/chat/completions [inference-gateway]                         2.9s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     2.9s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               2.8s
│               ╰── POST /v1/chat/completions [inference-gateway]             2.8s [error: *errors.errorString]
├── execute_tool Bash call_o8p8ib9n                                          1m13s
├── chat ollama_cloud/glm-5.3-flash                                           6.4s
│   ╰── POST /v1/chat/completions [inference-gateway]                         6.3s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     6.3s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               6.3s
│               ╰── POST /v1/chat/completions [inference-gateway]             6.3s [error: *errors.errorString]
├── execute_tool Bash call_lyeprauq                                           1.7s
├── chat ollama_cloud/glm-5.3-flash                                           7.2s
│   ╰── POST /v1/chat/completions [inference-gateway]                         7.2s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     7.1s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               7.1s
│               ╰── POST /v1/chat/completions [inference-gateway]             7.1s [error: *errors.errorString]
├── execute_tool TodoWrite call_jsek1etx                                      60µs
├── execute_tool Bash call_3g49k9cb                                          15.9s
├── chat ollama_cloud/glm-5.3-flash                                           4.4s
│   ╰── POST /v1/chat/completions [inference-gateway]                         4.4s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     4.3s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               4.3s
│               ╰── POST /v1/chat/completions [inference-gateway]             4.3s [error: *errors.errorString]
├── execute_tool Bash call_m7frjcfc                                          973µs
├── chat ollama_cloud/glm-5.3-flash                                           6.3s
│   ╰── POST /v1/chat/completions [inference-gateway]                         6.1s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     6.0s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               6.0s
│               ╰── POST /v1/chat/completions [inference-gateway]             6.0s [error: *errors.errorString]
├── execute_tool Bash call_24lipk2c                                          618ms
├── chat ollama_cloud/glm-5.3-flash                                           3.4s
│   ╰── POST /v1/chat/completions [inference-gateway]                         3.3s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     3.1s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               3.1s
│               ╰── POST /v1/chat/completions [inference-gateway]             3.1s [error: *errors.errorString]
├── execute_tool Wait call_iq1cjmfo                                          3m10s
├── chat ollama_cloud/glm-5.3-flash                                           5.2s
│   ╰── POST /v1/chat/completions [inference-gateway]                         5.1s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     5.1s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               5.1s
│               ╰── POST /v1/chat/completions [inference-gateway]             5.1s [error: *errors.errorString]
├── chat ollama_cloud/glm-5.3-flash                                          11.0s
│   ╰── POST /v1/chat/completions [inference-gateway]                        10.9s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]    10.9s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]              10.9s
│               ╰── POST /v1/chat/completions [inference-gateway]            10.9s
├── execute_tool Bash call_ly1q32cs                                          1m23s [error: tool_error]
├── chat ollama_cloud/glm-5.3-flash                                          15.1s
│   ╰── POST /v1/chat/completions [inference-gateway]                        15.1s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]    15.0s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]              15.0s
│               ╰── POST /v1/chat/completions [inference-gateway]            15.0s [error: *errors.errorString]
├── execute_tool TodoWrite call_fe3gf08k                                      82µs
├── execute_tool Write call_iho79gp5                                         866µs
├── chat ollama_cloud/glm-5.3-flash                                           3.9s
│   ╰── POST /v1/chat/completions [inference-gateway]                         3.9s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     3.9s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               3.9s
│               ╰── POST /v1/chat/completions [inference-gateway]             3.9s [error: *errors.errorString]
├── execute_tool Bash call_2vryf0xr                                           1.9s
├── chat ollama_cloud/glm-5.3-flash                                          10.6s
│   ╰── POST /v1/chat/completions [inference-gateway]                        10.5s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]    10.5s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]              10.5s
│               ╰── POST /v1/chat/completions [inference-gateway]            10.5s [error: *errors.errorString]
├── execute_tool Bash call_whci4xgn                                           1.5s
├── chat ollama_cloud/glm-5.3-flash                                           7.8s
│   ╰── POST /v1/chat/completions [inference-gateway]                         7.7s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     7.7s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               7.7s
│               ╰── POST /v1/chat/completions [inference-gateway]             7.7s [error: *errors.errorString]
├── execute_tool Memory call_n8fzjw2l                                         84µs [error: tool_error]
├── chat ollama_cloud/glm-5.3-flash                                           6.1s
│   ╰── POST /v1/chat/completions [inference-gateway]                         6.0s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     6.0s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               6.0s
│               ╰── POST /v1/chat/completions [inference-gateway]             6.0s [error: *errors.errorString]
├── execute_tool Memory call_1j8dlz39                                         1.9s
├── chat ollama_cloud/glm-5.3-flash                                           4.5s
│   ╰── POST /v1/chat/completions [inference-gateway]                         4.4s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     4.4s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               4.4s
│               ╰── POST /v1/chat/completions [inference-gateway]             4.4s [error: *errors.errorString]
├── execute_tool Bash call_d6e7raay                                            8ms
├── chat ollama_cloud/glm-5.3-flash                                           5.7s
│   ╰── POST /v1/chat/completions [inference-gateway]                         5.6s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     5.6s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               5.6s
│               ╰── POST /v1/chat/completions [inference-gateway]             5.6s [error: *errors.errorString]
├── execute_tool Bash call_yndwwfgd                                           1.3s [error: tool_error]
├── chat ollama_cloud/glm-5.3-flash                                           6.3s
│   ╰── POST /v1/chat/completions [inference-gateway]                         6.2s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     6.2s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               6.2s
│               ╰── POST /v1/chat/completions [inference-gateway]             6.2s [error: *errors.errorString]
├── execute_tool TodoWrite call_bh9g79vo                                      68µs
╰── chat ollama_cloud/glm-5.3-flash                                          10.6s
    ╰── POST /v1/chat/completions [inference-gateway]                        10.5s
        ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]    10.5s [error: *errors.errorString]
            ╰── POST /proxy/:provider/*path [inference-gateway]              10.5s
                ╰── POST /v1/chat/completions [inference-gateway]            10.5s [error: *errors.errorString]
Stats
Tool Calls

╭───────────┬───────┬───────┬──────────╮
│ Tool      │ Calls │ Fail% │ Avg      │
├───────────┼───────┼───────┼──────────┤
│ Bash      │ 34    │ 12%   │ 12759ms  │
│ Read      │ 32    │ 3%    │ 0ms      │
│ Grep      │ 21    │ 0%    │ 21ms     │
│ TodoWrite │ 8     │ 0%    │ 0ms      │
│ Write     │ 6     │ 0%    │ 0ms      │
│ Memory    │ 4     │ 25%   │ 474ms    │
│ Edit      │ 4     │ 0%    │ 0ms      │
│ MultiEdit │ 3     │ 0%    │ 0ms      │
│ Wait      │ 1     │ 0%    │ 189500ms │
╰───────────┴───────┴───────┴──────────╯

Token Usage

╭────────────────────────────┬──────────┬────────┬────────────┬──────────┬──────╮
│ Model                      │ Prompt   │ Cached │ Completion │ Total    │ Cost │
├────────────────────────────┼──────────┼────────┼────────────┼──────────┼──────┤
│ ollama_cloud/glm-5.3-flash │ 11391944 │ 0      │ 42587      │ 11434531 │ -    │
╰────────────────────────────┴──────────┴────────┴────────────┴──────────┴──────╯

Sessions

╭───────────┬──────────┬──────────╮
│ Execution │ Mode     │ Sessions │
├───────────┼──────────┼──────────┤
│ headless  │ headless │ 1        │
╰───────────┴──────────┴──────────╯

Triggered by edenreich · Infer Action · OSS

@inference-gateway-maintainer
inference-gateway-maintainer Bot marked this pull request as ready for review September 2, 2026 13:20
@inference-gateway-maintainer
inference-gateway-maintainer Bot requested a review from a team as a code owner September 2, 2026 13:20
Comment thread config/approval_test.go Resolved
Comment thread config/config.go Resolved
Comment thread internal/agent/domain/chat_events.go Resolved
type the judge verdict constants and retype judgeverdict.decision and judgeverdictchatevent.decision as agentdomain.judgedecision; wire format and behavior unchanged
Comment thread internal/agent/approval_policy_test.go Resolved
Comment thread internal/agent/agent_event_driven.go Resolved
- key mode-change guidance, subagent inheritance, and telemetry by ModeKey so
  auto-with-judge no longer collapses to standard
- JudgeRequired only reads approval_behaviour; headless fail-fasts on --mode
- send judge instructions as a system message with tagged data (judge.system_prompt)
- record judge token usage in session totals and telemetry
- emit judge_request on the debug channel; carry the reason in the tool result error
- drop dead fence stripping and the private effective() wrapper
- add e2e judge scenario, four-way mode cycle test
- a judge rejection is a failed tool result (rejected by judge: <reason>) so
  the driver reads the reason and continues; only a human rejection ends the turn
- route JudgeVerdictChatEvent through isDomainEvent and re-arm the chat
  listener in its handler; the TUI was dropping every event after a verdict
- show the error text in the collapsed failed tool card
- e2e asserts the driver's follow-up after a judge rejection
…tool card

A judge rejection produces no tool data, so the card only said Execution
failed; the reason was hidden behind ctrl+o.
- judge.gateway_url / INFER_JUDGE_GATEWAY_URL gives the judge its own client so
  a real judge can approve a mock-driven session
- the judge model appears in the AUTO+JUDGE mode indicator, the verdict events
  (json / ag-ui / debug), the flash, and the rejected tool result
Comment thread config/approval_test.go Resolved
Comment thread config/approval_test.go Resolved
Comment thread config/approval_test.go Resolved
Comment thread internal/agent/domain/judge.go Resolved
Comment thread internal/agent/domain/judge.go Resolved
Comment thread internal/agent/agent.go Resolved
@edenreich
edenreich merged commit 1dc0d00 into main Sep 2, 2026
1 check passed
@edenreich
edenreich deleted the fix/issue-1147 branch September 2, 2026 18:01
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.188.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@inference-gateway-releaser inference-gateway-releaser Bot added the released Shipped in a release label Sep 2, 2026
edenreich added a commit that referenced this pull request Sep 17, 2026
## Context

AGENTS.md already follows the open standard at https://agents.md (a
README for coding agents at a predictable location, no required
structure). Auditing it against the current tree found it accurate
except one stale spot: the tool-approval guidance predates the
`auto-with-judge` agent mode (#1148).

## Changes

Two bullets in **Security Gotchas**:

- `approval_behaviour` now includes `judge` — an LLM judge decides gated
calls (config `judge.yaml`; forced by the `auto-with-judge` agent mode —
see docs/judge-mode.md).
- `auto-with-judge` maps to the `standard` bash allow-list bucket: the
judge gates calls, it never widens the list
(`config/bash_allowedlist.go`).

`CLAUDE.md` is a symlink to `AGENTS.md`, so both stay in sync from this
one edit.

## Verification

- Facts cross-checked against `config/bash_allowedlist.go`,
`config/judge.go`, `docs/judge-mode.md`,
`internal/agent/domain/agent_mode_test.go`.
- `flox activate -- task precommit:run` passes (mod:tidy → fmt →
lint:imports → golangci-lint `0 issues` → markdownlint).

Per the /init flow, this PR is left open for human review — not merging.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Shipped in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Add auto-with-judge agent mode: an LLM judge as the approver in the tool-approval gate

1 participant