Skip to content

feat(cli): inspect saved scan and worker logs - #349

Merged
ianw-oai merged 3 commits into
mainfrom
dev/ianw/codex-security-scan-logs
Aug 11, 2026
Merged

feat(cli): inspect saved scan and worker logs#349
ianw-oai merged 3 commits into
mainfrom
dev/ianw/codex-security-scan-logs

Conversation

@ianw-oai

@ianw-oai ianw-oai commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Save the scan session ID when work starts, even if the scan fails.
  • Add scans logs SCAN_ID to return saved scan and worker events directly.
  • Exclude unrelated scans and inherited worker history.
  • Keep event contents unchanged; logs can contain source code and credentials.
  • API-key scans also need fix(sdk): keep API-key scan logs after scans finish #348 to keep their session logs.

Tests

  • 272 scan, CLI, session, and API tests passed.
  • Types, formatting, build, and package checks passed.

@github-actions github-actions Bot added the enhancement New feature or request label Aug 11, 2026

@mldangelo-oai mldangelo-oai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for adding scan/worker log visibility and preserving session IDs for failed scans; both are directly helpful for auditability.

A few edge cases I noticed while exercising this:

  • set_scan_thread currently overwrites continuation_thread_id even when another owner is already set or the scan has completed. The earlier commit already had running-state/existing-owner checks; restoring those would preserve the existing ownership and cancellation behavior.
  • scans logs always searches the dedicated SDK home, while native plugin scans can have their sessions under the ambient Codex home. In a fixture, the session existed but the command could not find it from the managed home.
  • Session-parent discovery does not recognize forked_from_id, although the existing workbench usage helper does; a forked worker was omitted in my check.

It might be possible to reuse the existing session-lineage discovery to cover both the home/lineage cases and avoid parsing every unrelated historical session. Happy to separate anything that is intentionally CLI-only from the broader plugin behavior.

@ianw-oai
ianw-oai merged commit 7b2896c into main Aug 11, 2026
19 checks passed
@ianw-oai
ianw-oai deleted the dev/ianw/codex-security-scan-logs branch August 11, 2026 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants