Repository navigation
Conversation
`pipeline/consolidate.py:324` carried a hardcoded 180s `call_haiku` timeout with no config key, in the staging -> recent/archive consolidation path. Output length scales with input length, so a large enough staging batch could time out on every run, be left uncompressed, and grow further every round with no recovery -- the same shape #788 reported and #792 fixed for the sibling NDC now.md -> today-*.md path via `thresholds.ndc_timeout_seconds`. Threads a new `timeout` parameter through `consolidate()`, `cmd_consolidate()` and the `pipeline.shell consolidate` CLI dispatch (new positional argv[7]), read by `run-consolidation.sh` from the new `thresholds.consolidate_timeout_seconds` config key (default 180, same digit-only guard as the NDC key). Documents the key in config.example.json and docs/configuration.md, and adds a changelog fragment. Regression tests mirror tests/test_ndc_reject_gate.py's own TestNdcTimeoutIsConfigurable shape: a configured-value-reaches-the-call test plus a default-stays-180 negative control, at both the consolidate() and cmd_consolidate() layers, plus CLI-dispatch coverage for the new argv position. Also fixes a pre-existing test's consolidate() stub (TestConsolidateSnapshot.test_the_snapshot_is_what_gets_read) that did not accept the new timeout kwarg. Closes #806. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Self-review follow-up for the previous commit: - pipeline/shell.py: a comment near STAGING_PATHS_FILE's byte-count rationale still described the Haiku call's budget as a fixed "180s", which the previous commit made configurable. Updated to say "configurable budget (180s by default, thresholds.consolidate_timeout_seconds, #806)". - trap.d/806.timeout-guard-silent-substitution.md: logs a non-blocking finding from the auditor spawn -- the new digit-only guard in run-consolidation.sh (and its pre-existing sibling in save-session.sh for thresholds.ndc_timeout_seconds) silently falls back to the default 180 on a malformed config value, with nothing in the daily log distinguishing a deliberate 180 from a discarded typo. Ranked `misreports`, non-blocking, not a release blocker -- logged rather than filed, since it mirrors already-shipped behavior rather than something this diff introduces. Co-Authored-By: Claude Sonnet 5 <[email protected]>
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.
Adds
thresholds.consolidate_timeout_seconds(default 180) and reads it at the staging-consolidationcall_haikucall site inpipeline/consolidate.py, replacing the hardcodedtimeout=180literal the issue names. Threaded throughcmd_consolidate()inpipeline/shell.py(both the normal path and the oversized-archive rotation-retry path) and thepipeline.shell consolidateCLI dispatch, and read inscripts/run-consolidation.shwith a digit-only guard mirroring the siblingthresholds.ndc_timeout_secondsguard from #788/#792. Documented inconfig.example.jsonanddocs/configuration.md; changelog fragment atchangelog.d/806.fixed.md.Closes #806
Tests
Red (with the fix stashed):
python3 -m pytest tests/test_consolidate.py::TestConsolidateTimeoutIsConfigurable tests/test_shell.py::test_cmd_consolidate_passes_timeout_to_consolidate tests/test_shell.py::test_cmd_consolidate_default_timeout_is_still_180 tests/test_shell.py::test_main_dispatches_consolidate tests/test_shell.py::test_main_dispatches_consolidate_with_timeout -q --no-cov-> 5 failed, 1 passed (TypeError/AssertionError on the missingtimeoutkwarg).Green:
python3 -m pytest tests/test_consolidate.py tests/test_shell.py -q --no-cov-> 98 passed. Also ran the two real end-to-end shell-script tests exercisingrun-consolidation.shdirectly (test_consolidation_append_race.py,test_windows_glob_backslash_517.py): 27 passed.Full
pytestwas not run locally (per repo policy CI's cross-OS/interpreter matrix is the source of truth for that).Self-review
Two reviewers (Explore, oss:auditor) ran independently; tree confirmed clean before/after via tree_snapshot.py.
pipeline/shell.pyclaiming a fixed "180s budget", now naming the config key and this issue.scripts/run-consolidation.sh's new digit-only guard silently substitutes the default 180 on a malformed config value with no logging, so an operator can't tell a deliberate 180 from a discarded typo. Byte-for-byte the same shape as the already-shipped sibling guard inscripts/save-session.shforthresholds.ndc_timeout_seconds(NDC compression deadlocks once now.md grows past ~35 KB: fixed 180s timeout, no chunking, no fallback #788/fix(#788): configurable NDC timeout, tolerate a short reply preamble #792); fixing it properly means touching both scripts, wider than this issue's scope. Rankedmisreports, non-blocking, not a release blocker -- logged rather than filed, since it mirrors already-shipped behavior rather than something this diff introduces. Recorded attrap.d/806.timeout-guard-silent-substitution.md.🤖 Generated with Claude Code
[AI-generated]