Skip to content

Add debugging#53

Merged
derekmisler merged 1 commit intodocker:mainfrom
derekmisler:add-debugging
Feb 26, 2026
Merged

Add debugging#53
derekmisler merged 1 commit intodocker:mainfrom
derekmisler:add-debugging

Conversation

@derekmisler
Copy link
Contributor

@derekmisler derekmisler commented Feb 25, 2026

Summary

This PR improves the debugging experience for the cagent GitHub Action by separating verbose agent output (including tool calls) from the clean output used by downstream steps. Instead of suppressing tool call output via a quiet flag, all raw agent output is now captured to a dedicated verbose log file that is uploaded as a workflow artifact, while a clean version is produced via awk filtering for downstream consumption.

Changes

  • action.yml – Remove quiet input: The quiet input (which passed --hide-tool-calls --hide-tool-results to cagent) is removed entirely. Tool call output is no longer suppressed at the source.
  • action.yml – Verbose log capture: Agent execution now redirects all stdout/stderr to a new temp file (/tmp/cagent-verbose-XXXXXX) instead of teeing to the console. Retry attempts append a timestamped separator to the verbose log rather than truncating it.
  • action.ymlverbose-log-file output: A new verbose-log-file output exposes the path to the full verbose log for downstream steps or callers.
  • action.ymlawk filtering moved earlier: The awk block that strips thinking blocks, tool calls, and internal markers now runs immediately after agent execution to produce the clean OUTPUT_FILE, rather than being a fallback in the sanitize step. The cagent-output code block extraction remains as an override on top of this.
  • action.yml – Artifact upload step: A new Upload verbose agent log step (using actions/upload-artifact@v4.6.2) always runs and uploads the verbose log as cagent-verbose-log-<run_id>-<run_attempt> with a 14-day retention.
  • README.md: Removes the quiet parameter from the example config and parameter table; adds verbose-log-file to the outputs table.

How to Test

  • Trigger the action on a workflow and check the Artifacts section of the run — a cagent-verbose-log-* artifact should appear containing the full raw agent output including tool calls.
  • Verify that downstream steps still receive clean output (no tool call blocks, thinking blocks, or internal markers) via the output-file path.
  • Confirm that removing the quiet: false line from existing workflow configs does not break anything, since the input no longer exists.

Closes: https://github.com/docker/gordon/issues/181

@derekmisler
Copy link
Contributor Author

/describe

@derekmisler derekmisler marked this pull request as ready for review February 25, 2026 16:40
@derekmisler derekmisler requested a review from a team as a code owner February 25, 2026 16:40
@docker-agent
Copy link

docker-agent bot commented Feb 25, 2026

✅ PR description has been generated and updated!

Copy link

@docker-agent docker-agent bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Found 1 high-severity issue in the verbose logging implementation. The mktemp template format is incorrect, which could cause log file creation to fail silently or create files with unexpected names.

Critical Issue

The mktemp template uses an invalid format with X's before the file extension, which may cause failures or unpredictable behavior. Additionally, there's no validation that mktemp succeeded before using the file path.

@derekmisler derekmisler marked this pull request as draft February 25, 2026 16:44
@derekmisler derekmisler marked this pull request as ready for review February 25, 2026 16:47
Copy link

@docker-agent docker-agent bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Found several issues with the output filtering implementation:

Critical Issues:

  • Empty code block extraction could silently delete all output
  • Inconsistent regex anchoring could capture unintended content
  • Overly broad tool block delimiter could skip legitimate output

Additional Concerns:

  • No validation that filtering produces non-empty output
  • Brittle awk patterns rely on specific cagent output format

The most serious issue is the lack of validation before overwriting OUTPUT_FILE with extracted code block content.

@derekmisler derekmisler marked this pull request as draft February 25, 2026 16:55
Signed-off-by: Derek Misler <derek.misler@docker.com>
@derekmisler derekmisler marked this pull request as ready for review February 25, 2026 17:12
Copy link

@docker-agent docker-agent bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

All potential issues identified during the review were verified and determined to be either working as intended or based on incorrect assumptions about the code behavior. The changes correctly implement the debugging improvements described in the PR:

✅ Properly separates verbose logs from clean output
✅ Correctly validates file creation with appropriate error handling
✅ Implements sound logic for cagent-output extraction with fallback to awk filtering
✅ Uses appropriate regex patterns for filtering tool output blocks

The refactoring maintains backward compatibility while improving debuggability by always capturing full verbose logs to an artifact.

No issues found. This PR looks good! 🎉

@derekmisler
Copy link
Contributor Author

/describe

@docker-agent
Copy link

docker-agent bot commented Feb 25, 2026

✅ PR description has been generated and updated!

@derekmisler derekmisler merged commit a16efb0 into docker:main Feb 26, 2026
11 checks passed
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.

2 participants