@senior: opencode logs #3

Merged
ffaerber merged 1 commits from ai/issue-2 into main 2026-07-02 15:21:48 +02:00

The implementation is complete and verified. Let me commit and push.
Pushed to ai/issue-2. The implementation is complete and verified locally.

Built against the real opencode run --format json schema (validated locally):

  • Run agent now uses --format json → captures /tmp/events.jsonl, then reconstructs /tmp/agent_out.md from assistant text parts (equivalent to plain --auto output, so all existing Publish/awk marker parsing is unchanged).
  • Build activity log step (dev agents only) filters to tool_use (tool + truncated title/input — includes commits) and text (reasoning) → /tmp/activity_log.md.
  • Publish posts it as a separate collapsible <details> comment on the PR thread — additive to the summary comment.
  • Removed both TEMP/DEBUG schema-discovery steps.
  • Reasoning reuse on re-trigger is free: the existing "fetch full issue thread" step already feeds prior comments back into the next run's prompt.

Summary

Post the agent's opencode activity trail (tool calls + reasoning) as a separate comment on the PR thread, so a follow-up run can see what the previous run did. Replaces the throwaway TEMP/DEBUG schema-discovery commits with the real implementation. Switches the "Run agent" step from plain --auto to --auto --format json, captures the raw event stream, and reconstructs the plain-text reply from assistant text parts so the existing Publish logic is unchanged.

Changes

  • Removed the two TEMP/DEBUG steps (commits da6f0d5, d0ddb06) — schema discovery is done.
  • "Run agent": --format json/tmp/events.jsonl; reconstruct /tmp/agent_out.md from text parts; transient-error grep now targets events.jsonl.
  • New "Build activity log" step: jq parser filtering tool_use (truncated title/input, includes commits) + text (reasoning) → /tmp/activity_log.md; dev agents only (comment-only roles produce empty/noise logs).
  • "Publish": posts the activity log as a separate collapsible <details> PR comment — additive to the existing summary/PR-description comment.
  • Reasoning continuity on re-trigger needs no extra state: the existing "Fetch the full issue thread" step already re-feeds all prior comments (including the new log comment) into the next run's prompt.

Resolves #2 · 🤖 @senior

The implementation is complete and verified. Let me commit and push. Pushed to `ai/issue-2`. The implementation is complete and verified locally. Built against the real `opencode run --format json` schema (validated locally): - **Run agent** now uses `--format json` → captures `/tmp/events.jsonl`, then reconstructs `/tmp/agent_out.md` from assistant `text` parts (equivalent to plain `--auto` output, so all existing Publish/awk marker parsing is unchanged). - **Build activity log** step (dev agents only) filters to `tool_use` (tool + truncated title/input — includes commits) and `text` (reasoning) → `/tmp/activity_log.md`. - **Publish** posts it as a separate collapsible `<details>` comment on the PR thread — additive to the summary comment. - Removed both `TEMP`/`DEBUG` schema-discovery steps. - Reasoning reuse on re-trigger is free: the existing "fetch full issue thread" step already feeds prior comments back into the next run's prompt. ## Summary Post the agent's opencode activity trail (tool calls + reasoning) as a separate comment on the PR thread, so a follow-up run can see what the previous run did. Replaces the throwaway `TEMP`/`DEBUG` schema-discovery commits with the real implementation. Switches the "Run agent" step from plain `--auto` to `--auto --format json`, captures the raw event stream, and reconstructs the plain-text reply from assistant `text` parts so the existing Publish logic is unchanged. ## Changes - Removed the two `TEMP`/`DEBUG` steps (commits `da6f0d5`, `d0ddb06`) — schema discovery is done. - "Run agent": `--format json` → `/tmp/events.jsonl`; reconstruct `/tmp/agent_out.md` from `text` parts; transient-error grep now targets `events.jsonl`. - New "Build activity log" step: jq parser filtering `tool_use` (truncated title/input, includes commits) + `text` (reasoning) → `/tmp/activity_log.md`; dev agents only (comment-only roles produce empty/noise logs). - "Publish": posts the activity log as a separate collapsible `<details>` PR comment — additive to the existing summary/PR-description comment. - Reasoning continuity on re-trigger needs no extra state: the existing "Fetch the full issue thread" step already re-feeds all prior comments (including the new log comment) into the next run's prompt. --- Resolves #2 · 🤖 @senior
gitea-actions bot added 1 commit 2026-07-02 15:17:52 +02:00
Switch the real 'Run agent' step to --format json (replacing the two
TEMP/DEBUG schema-discovery commits da6f0d5/d0ddb06), capture the raw
event stream, and reconstruct the plain-text reply from the assistant
'text' parts so the existing Publish logic is unchanged.

Add a 'Build activity log' step that filters the event stream to
tool_use (with truncated title/input) and text (reasoning) events.
The Publish step posts that trail as a separate collapsible comment on
the PR thread (dev agents only — comment-only roles do no tool calls).

This is additive to the existing summary/PR-description comment.
Reasoning reuse on a follow-up run is free: the existing 'fetch full
issue thread' step already re-feeds all prior comments (including this
new log comment) into the next run's prompt, so the agent sees what it
did last time.
ffaerber merged commit 0fa2e7b6d8 into main 2026-07-02 15:21:48 +02:00
ffaerber deleted branch ai/issue-2 2026-07-02 15:21:50 +02:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: gitea/agents#3