feat(tui): make session history window configurable#17046
Open
seilk wants to merge 1 commit intoanomalyco:devfrom
Open
feat(tui): make session history window configurable#17046seilk wants to merge 1 commit intoanomalyco:devfrom
seilk wants to merge 1 commit intoanomalyco:devfrom
Conversation
Add session_history_days to opencode.json config (default: 30, 0 to disable). The TUI bootstrap previously hard-coded a 30-day time window for session list fetching, making projects untouched for >30 days appear empty in the /sessions picker. The session list request is now chained after the config fetch so the setting is available before the query fires.
6 tasks
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.
Issue for this PR
Related: #16270, #16733, #13877, #16878
Type of change
What does this PR do?
The TUI bootstrap hard-codes a 30-day window when fetching sessions. If
you haven't touched a project in over a month, the
/sessionspickercomes up empty — even though the data is right there in the DB and the
CLI returns it fine. This trips up a lot of people (#16270, #16733,
#13877) into thinking their sessions got nuked.
The 30-day cap makes sense as a default — nobody wants to pull thousands
of sessions on every boot. But it shouldn't be a wall you can't move.
This adds
session_history_daysto the main config:Since the value lives in server config, the session list request is
chained after the config fetch so the setting is available before the
query fires. No extra round-trip — config was already being fetched in
the same bootstrap batch.
How did you verify your code works?
Tested against a real DB (2,823 sessions, project last active 41 days ago):
600Typecheck and build both pass.
Note
This only addresses the time window. The child session dilution issue
(missing
roots: true) is tracked separately in #16273.Checklist