Skip to content

Improve agent log parsing#1429

Draft
gjkim42 wants to merge 1 commit into
mainfrom
update-log-parsing
Draft

Improve agent log parsing#1429
gjkim42 wants to merge 1 commit into
mainfrom
update-log-parsing

Conversation

@gjkim42

@gjkim42 gjkim42 commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

What type of PR is this?

/kind bug

What this PR does / why we need it:

Improves agent log parsing for OpenCode JSON streams that emit nested step, tool, and token events. kelos logs now shows OpenCode step boundaries, tool summaries, usage, truncation, and non-zero exits without dumping full tool output.

This also updates reporting progress/activity and result capture so nested OpenCode text is recognized, and Gemini capture accepts total token stats.

Which issue(s) this PR is related to:

N/A

Special notes for your reviewer:

Validation:

  • make test
  • make verify
  • git diff --check

Does this PR introduce a user-facing change?

Improve agent log parsing for OpenCode JSON streams so kelos logs, progress/activity reporting, and captured task responses handle nested OpenCode events.

Summary by cubic

Improves agent log parsing for OpenCode JSON streams. kelos logs now shows clear step boundaries, concise tool summaries, and usage stats without dumping noisy tool output; progress/activity and captured responses handle nested OpenCode text, and Gemini usage accepts total token stats.

  • New Features
    • Print numbered step boundaries (“--- Step N ---”) for OpenCode runs.
    • Summarize tool_use events (bash/shell, read/write/edit, grep/glob, webfetch, websearch), include non‑zero exit and truncated, and suppress full tool output.
    • Emit [usage] on step_finish with input, cached, output, plus reasoning, cache_write, and total when present.
    • Parse nested OpenCode text for progress/activity and final response capture; accept Gemini totalInputTokens and totalOutputTokens in usage extraction.

Written for commit 76da819. Summary will update on new commits.

Review in cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant