Repository navigation
fix(kb): keep replay capture growth from stopping nightly intake - #338
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e80e0484df
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| store.append('decision', context=context, result={'type': 'replay_capture_deferred', 'reason': 'size_limit', | ||
| 'input_bytes': len(encoded), 'limit_bytes': REPLAY_INPUT_MAX_BYTES, 'input_sha': input_sha}) |
There was a problem hiding this comment.
Avoid appending duplicate deferrals on every retry
When an oversized item belongs to an active workflow, run_intake deliberately leaves it pending, so each subsequent intake interval calls capture again and appends another identical deferred record. collect queries only the oldest 10,000 workflow records and filters for replay_input afterward; once repeated deferrals fill that window, every newer valid capture becomes permanently invisible to dataset collection. Deduplicate deferred records for the same item/hash or make collection paginate/filter without counting these records toward its limit.
Useful? React with 👍 / 👎.
Nightly knowledge intake stopped before drafting because the complete knowledge and companion-text snapshot grew to 16.08 MB, exceeding the 16 MB replay capture limit. All 28 pending inputs hit the same failure.
Allow complete replay envelopes up to a bounded 64 MB, keeping TraceStore redaction, compression, hashing and dataset validation. Record a distinct capture deferral for larger envelopes without saving partial inputs. Ordinary pinned drafting can continue after that deferral; an active or disabled evolved KB workflow, or an unverifiable active registry, leaves the event pending. Other capture failures still block. Publication, calibration and model gates are unchanged.
Validation: 189 focused tests passed (1 skipped), including exact 16.08 MB runtime capture/collection, UTF-8 byte bounds, active/disabled/corrupt registry cases and PR review capture fallback/rollback. Documentation links, citations and strict SPEC freshness pass. Full CI must pass before merge and native rollout.