Skip to content

fix: attribute shared-harness security calls as auxiliary - #996

Open
time-attack wants to merge 1 commit into
mainfrom
fix/auxiliary-screen-attribution
Open

fix: attribute shared-harness security calls as auxiliary#996
time-attack wants to merge 1 commit into
mainfrom
fix/auxiliary-screen-attribution

Conversation

@time-attack

@time-attack time-attack commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Fixes #889. Reported by @ianTPE from a running QM deployment.

The shared one-shot runner fabricated turn 1 and forwarded its LLM recorder unchanged. Security screens in the Claude, Codex, and OpenCode harnesses consequently appeared as steps of the real conversation's first turn, and were absent from the security-screen replay corpus.

This fixes the shared path once:

  • One-shot request records get turnSeq: null.
  • Only screenSecurity stamps the existing SECURITY_SCREEN_STEP, matching Pi and the mock harness.
  • Records, usage fields, errors, and request cancellation are preserved. No calls are deduplicated or discarded; no schema change or historical-data rewrite.

Validation

  • Regression tests failed before the fix and pass afterward.
  • Affected harness sweep: 123 passed, 1 existing skip, 0 failed.
  • Harness-shared, auto-flagger, and admin-observability suites: 38 passed, 0 failed.
  • Core typecheck, full ESLint, and full Oxlint passed.
  • Independent fresh-context review accepted the patch; the request-signal naming nit was addressed.

The new tests cover both generic one-shot attribution and screening-specific coordinates. The production change is confined to the shared harness helper.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Mark isolated one-shot LLM requests with a null turn sequence, and apply the existing security-screen step only at the screen utility. Preserve per-call records and align Claude, Codex, and OpenCode with the Pi recording convention.

Co-authored-by: Ian Chou <ertiach@gmail.com>
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.

Auxiliary model calls write usage rows under the caller's session_id but the one-shot's own (turn_seq, step) — always (1, 0)

1 participant