Repository navigation
feat(agents): project live sessions and loaded history in Core - #247
Merged
Merged
Conversation
Share the bounded entry index, revisioned reads, file summaries and retry validation across live sessions and loaded history pages. Refs 1lck/Lithe-IDEA#2552.
27 of 31 tasks
Resolve changed paths against the session directory, account for diff text in the row budget and keep retained row identities across CLI restarts.
WhiteZeek
marked this pull request as ready for review
December 2, 2026 03:08
xiaoyumuxi
reviewed
Dec 2, 2026
xiaoyumuxi
left a comment
Contributor
There was a problem hiding this comment.
审了一遍,配套桌面 #2620。主要问题是 retry 的错误码一码多义、文案不准,以及恢复会话后丢行计数变小;另外两条是契约健壮性问题,眼下不会触发,需要作者确认意图。详见行内评论。
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.
Refs 1lck/Lithe-IDEA#2552
Desktop integration and Windows UI verification: 1lck/Lithe-IDEA#2620.
What changes
The Agent runtime projects accepted prompts, streamed messages, tool calls and interaction state into a bounded session view. Entries keep their identity when older rows are trimmed or history is prepended.
Loaded history pages use the same index and capacity limits as live replies. A read-only viewer owns its own window. A resumed live session can install the last page read before the CLI started.
Desktop clients can read a snapshot or request changes after a revision. Oversized rows are transferred in chunks. The runtime validates regeneration against the selected opening prompt and tracks changed files for the session, turn and reply.
Projected tool calls keep the bounded diff payload across partial updates. The changed-file lists resolve relative paths against the session working directory and deduplicate paths across tool diffs and locations.
A resumed process can inherit the earlier view’s retained rows. Existing row serials remain stable, previous turns move into the historical number range, and revoked disk history is excluded.
Live rows keep their source across repeated resumes and read-permission changes. A detached history viewer starts a fresh window when the incoming page would overflow. Its file cursor advances only across complete source lines that fit after folding partial tool calls and mirrored records. Revoking the read grant also invalidates pending snapshots and serialized response chunks after row eviction.
The memory estimate includes tool locations and their changed-file indexes. History uses separate keys for mirror IDs and tool-call IDs. Retry requires the complete original prompt, including at UTF-8 boundaries. Failed CLI exits retain the bounded stderr tail in the projection header.
The application contracts, shared fixture and runtime tests cover the new operations. The existing event API and record storage remain available.
Compact waits preserve full events for sessions without an active projection. Resuming preserves the dropped-output count. Thought and assistant rows may reuse an ID without mixing their text. Regeneration reports an invalid mode separately from an unavailable original prompt.
Verification
Windows x64 passed all 84 Agent runtime tests on
b67ed19. Clippy, Rust comment checks and contract documentation checks passed.Windows x64 passed 67 Agent runtime tests on
53ba69a, including overlap between history pages, mixed history/live capacity, UTF-8 limits, stale revisions, permissions, retry identity and view release. Rust Clippy and Core comment checks passed.The same runtime was exercised from a Windows native workbench using a synthetic Agent. Sending, incremental replies, permission confirmation, retry, resume from a disk record and opening a changed file passed.
In the long-session fixture, 100 one-byte appends transferred 15,100 response bytes, compared with 19,100 over the existing event path. Median handler time was 129.5 versus 112.0 microseconds. Peak test-process working set was 18.51 versus 16.31 MiB.
Still pending
The full
lithe-core --libtest binary exceeded the 1,900 MiB build limit on this machine. Native macOS acceptance is pending. The matching desktop change pinsb67ed19. The provider test plugin reports a profile path beside its temporary configuration file. This gives it an absolute path on Windows and Unix. All 83 Agent runtime tests passed on Windows x64, including the nine provider tests that previously failed. The final desktop pin follows the merge into Core main.