Honor summary_timeout_seconds in explain --generate; raise default to 5m#1204
Merged
peyton-alt merged 2 commits intoMay 13, 2026
Merged
Conversation
The summary_timeout_seconds setting and SummaryTimeoutValue() helper existed in settings but were never consumed by `explain --generate`, which used a hardcoded 30s deadline. Fixes entireio#1198. Changes: - Wire SummaryTimeoutValue() into the generate path via a new resolveSummaryTimeout helper with precedence: per-run flag > settings > package default. - Add --summary-timeout-seconds flag on `entire checkpoint explain` for one-off overrides without editing JSON. - Add `entire configure --summarize-timeout-seconds` matching the existing --summarize-provider / --summarize-model family for persistent configuration. - Raise the package default from 30s to 5 minutes. SOTA models on large transcripts routinely exceed 30s; users wanting faster failure can set summary_timeout_seconds: 30 or pass --summary-timeout-seconds 30.
bbba8aa to
dce46d3
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR wires summary_timeout_seconds into entire checkpoint explain --generate, adds CLI/configure overrides, and raises the default summary-generation timeout to 5 minutes.
Changes:
- Adds timeout resolution precedence: per-run flag > settings value > package default.
- Adds
--summary-timeout-secondsforexplain --generateand--summarize-timeout-secondsforconfigure. - Updates settings documentation and adds/updates tests for timeout resolution and persistence.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
cmd/entire/cli/explain.go |
Applies resolved summary timeout through the explain/generate call chain. |
cmd/entire/cli/explain_test.go |
Updates call sites and adds timeout resolution/default tests. |
cmd/entire/cli/setup.go |
Adds configure support for persisting summary timeout settings. |
cmd/entire/cli/setup_test.go |
Adds tests for configure timeout persistence and validation. |
cmd/entire/cli/settings/settings.go |
Updates documentation for the now-consumed timeout setting. |
The flag validation block sat after the export-mode dispatch, so invocations like `explain --json --summary-timeout-seconds 10` or `explain --transcript --summary-timeout-seconds -5` returned via runExplainExport before the check ran, silently ignoring the flag (and accepting negative values). Move the validation alongside --session-index and --limit, which were already correctly placed above the export-mode return. Add regression coverage spanning the prose path, --json, --transcript, and --raw-transcript --session-index export modes.
peyton-alt
approved these changes
May 13, 2026
Contributor
peyton-alt
left a comment
There was a problem hiding this comment.
Approved, looks great! Thanks for the contribution!
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.
Fixes #1198.
Summary
summary_timeout_secondswas accepted by settings and aSummaryTimeoutValue()helper existed, butentire checkpoint explain --generateignored both and used a hardcoded 30s deadline — exactly what the field's own doc comment said was a TODO ("Not yet consumed by the generate path; present so settings round-trip for a follow-up change that wires it into the deadline selection.").This wires it up, adds a per-run override and a
configureflag, and raises the package default.Changes
Wire the setting. New
resolveSummaryTimeout(ctx, flagSeconds)incmd/entire/cli/explain.gopicks the effective deadline with precedence: per-run flag >summary_timeout_secondssetting > package default. Zero or negative at any layer means "unset; consult the next layer down" — matching the existingSummaryTimeoutValue()semantics.Per-run flag.
entire checkpoint explain --generate <id> --summary-timeout-seconds Noverrides the setting for a single invocation, no JSON editing required. Validated to be non-negative and rejected when used without--generate.Configure flag.
entire configure --summarize-timeout-seconds Npersists the value, mirroring the existing--summarize-provider/--summarize-modelfamily insetup.go. Passing0clears; negatives rejected.Default bumped 30s → 5 min. SOTA models on large transcripts routinely exceed 30s; the old default made
--generatelook broken on otherwise normal runs. Users wanting faster failure can setsummary_timeout_seconds: 30or pass--summary-timeout-seconds 30. Locked in viaTestDefaultCheckpointSummaryTimeout_IsFiveMinutesso a casual edit can't silently regress.Doc comment on
SummaryTimeoutSecondsupdated to reflect the wired-up behavior.Signature change
generateCheckpointAISummaryand therunExplain*plumbing chain take the new value as a positional arg, matching the existing positional-arg style in this file (provider/model already flow as positional fields from a resolver-returned struct). Not refactoring to an options struct here — that's a broader cleanup across all the existing positional bools and would be scope creep on a bug-fix PR.The package-level
checkpointSummaryTimeoutvar stays so the existing test-injection pattern (explain_test.golines 754, 845, 903, 938) keeps working and continues to serve as the single source of truth for the fallback default.Forward-compat with #964
The stream-driven
explain --generatework in #964 proposes a different deadline model (idle watchdog + hard cap, TTY-gated). This change touches only the deadline resolution, not the application model — if #964 lands, the same setting/flag surface can be re-wired to feed the new model. The user-facing API stays valid.Tests
New:
TestResolveSummaryTimeout_FlagOverridesSettingTestResolveSummaryTimeout_SettingHonoredWhenFlagUnsetTestResolveSummaryTimeout_DefaultWhenBothUnsetTestResolveSummaryTimeout_NegativeSettingTreatedAsUnsetTestDefaultCheckpointSummaryTimeout_IsFiveMinutes(regression lock-in)TestConfigureCmd_SummarizeTimeoutSeconds_WritesProjectSettingsTestConfigureCmd_SummarizeTimeoutSeconds_WritesLocalSettingsTestConfigureCmd_SummarizeTimeoutSeconds_ClearsValueTestConfigureCmd_SummarizeTimeoutSeconds_RejectsNegativeExisting four
TestGenerateCheckpointAISummary_*tests updated to pass timeout as a positional arg — the package-var injection pattern is preserved for the fallback-default path.Test plan
mise run check(fmt + lint + unit + integration + Vogon E2E canary) passes locallysummary_timeout_seconds: 3600,entire checkpoint explain --checkpoint <id> --generatenow honors the 3600s instead of timing out at 30sentire checkpoint explain --generate <id> --summary-timeout-seconds 120uses 120s regardless of settingentire configure --summarize-timeout-seconds 600writessummary_timeout_seconds: 600to settings--generatenow uses 5 min instead of 30s