Skip to content

fix(kohaku): quiet kt stderr noise + richer live-execution detail#4

Merged
Yidhar merged 2 commits into
mainfrom
fix/kohaku-stderr-noise
Jun 29, 2026
Merged

fix(kohaku): quiet kt stderr noise + richer live-execution detail#4
Yidhar merged 2 commits into
mainfrom
fix/kohaku-stderr-noise

Conversation

@Yidhar

@Yidhar Yidhar commented Jun 29, 2026

Copy link
Copy Markdown
Owner

Summary

Two follow-up fixes for the live display when KohakuTerrarium (kt) is the core.

1. Quiet kt stderr plugin noise (d756f5b)

kt-biome plugins (PEV verifier, OpenTelemetry exporter) log benign WARNING-level "plugin disabled / no-op" lines on every agent build:

PEV verifier has no acceptance_criteria; plugin disabled
opentelemetry packages not installed; plugin is no-op

Switchyard captures kt's stderr and surfaces it as a failed turn's error_message + an always-saved diagnostics artifact, so this noise dominated the view. The adapter now passes --log-level error to kt run; real turn outcomes arrive on the stdout JSONL (turn_end), independent of the stderr log level, so no failure signal is lost. fake_kt asserts the adapter always passes --log-level.

2. Richer live-execution detail for kt tool activity (4114914)

kt tool/subagent activity was mapped to a generic, content-less command_execution (every tool rendered as "Execute Command"). It now maps to a tool_call carrying the real tool name (from the kt job_id <tool>_<shortid>), the call arguments (path/content — shown via the card's Show-Input toggle, truncated when long), and the result. The stable job_id is the item id, so a tool's start (running, with args) and its done/error (with the result) merge into one transitioning card.

GUI live-execution card:

  • Headline falls back to the latest tool of any kind (not just shell commands), so non-command tool turns no longer read "暂无工具事件".
  • Adds a "已调用 N 个工具" count for non-command, non-edit tool calls.
  • Shows the latest 5 detail cards (was the first 5, which never scrolled to the newest activity) and notes how many earlier ones are folded.

Verification

cargo fmt --all -- --check, cargo clippy -p switchyard-provider-kohaku -p switchyard-tests --all-targets -- -D warnings (on Rust 1.96, matching CI), cargo test -p switchyard-provider-kohaku (14) + --test kohaku_integration (4), and the frontend npm run build all pass.

🤖 Generated with Claude Code

Yidhar and others added 2 commits June 29, 2026 14:43
kt-biome plugins (the PEV verifier and the OpenTelemetry exporter) log benign
WARNING-level "plugin disabled / no-op" lines on every agent build:
  PEV verifier has no acceptance_criteria; plugin disabled
  opentelemetry packages not installed; plugin is no-op
Switchyard captures kt's stderr and surfaces it as a failed turn's
error_message + an always-saved diagnostics artifact, so this benign noise
dominated the view (and repeated every turn).

Pass `--log-level error` to `kt run` so only real errors reach stderr. Actual
turn outcomes arrive on the stdout JSONL (`turn_end`), independent of the
stderr log level, so no failure signal is lost. fake_kt now asserts the
adapter always passes --log-level.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Map kt tool/subagent activity to `tool_call` items carrying the real tool name
(derived from the kt job_id "<tool>_<shortid>"), the call arguments
(path/content — shown via the card's Show-Input toggle, truncated when long),
and the result — instead of the generic, content-less `command_execution`
previously emitted (which rendered every tool as "Execute Command" with no
content). The kt job_id is stable across start/done, so it's used as the item
id and a tool's start (running, with args) merges with its later done/error
(with the result) into one transitioning card.

GUI live-execution card (RenderHelpers):
- Headline falls back to the latest tool of ANY kind (not just shell commands),
  so non-command tool turns no longer read "暂无工具事件".
- Adds a "已调用 N 个工具" summary count for non-command, non-edit tool calls.
- Shows the LATEST 5 detail cards (was the first 5, which never scrolled to the
  newest activity) and notes how many earlier ones are folded.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Yidhar
Yidhar merged commit c3c4bf6 into main Jun 29, 2026
1 check passed
@Yidhar
Yidhar deleted the fix/kohaku-stderr-noise branch June 29, 2026 08:37
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.

1 participant