fix(logs): bound saved activity by scan completion - #556
Open
sylvesterkaczmarek wants to merge 2 commits into
Open
fix(logs): bound saved activity by scan completion#556sylvesterkaczmarek wants to merge 2 commits into
sylvesterkaczmarek wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Keep saved scan activity logs bounded by the scan's recorded completion time so same-thread post-scan events are not presented as scan history.
Fixes #555.
Reproduction / evidence
Current upstream
mainat37bf87a692fc72d41f7312cc48808d699d204fbausescompletedAtwhile deciding whether independent Deep worker sessions belong to a scan, but after sessions are selected it appends every event from those sessions without checking the completion boundary.The SDK lifecycle completes and persists the scan first, then, when a
postScanPromptis configured, invokes that follow-up on the same Codex thread.A root session with events at
08:01, scan completion at08:02, and a post-scan event at08:03therefore currently returns both events fromreadScanLogs().Root cause
The saved completion timestamp was enforced at the session-selection boundary but not at the per-event projection boundary.
Fix
completedAtonce for event projection;completedAtis null;Tests / validation
Added
scan-logs-completion.test.tswith a single root-session fixture containing:The regression requires the pre-completion and legacy events to remain while the post-completion event is excluded.
The branch is based directly on current upstream
mainat37bf87a692fc72d41f7312cc48808d699d204fbaand is not behind it. Production change: 11 additions, 0 deletions.Full repository tests cannot be run in this execution environment because the repository cannot be cloned here. Pushed-head CI remains the authoritative full-suite validation.
Risk
Low. The change only narrows completed saved logs when both the scan completion time and an event timestamp are valid. Running scans and legacy untimestamped rollout records retain their prior behavior.