Skip to content

feat(agents): project live sessions and loaded history in Core - #247

Merged
xiaoyumuxi merged 7 commits into
Lithe-IDEA:mainfrom
WhiteZeek:feat/2552-agent-projection
Dec 2, 2026
Merged

xiaoyumuxi merged 7 commits into
Lithe-IDEA:mainfrom
WhiteZeek:feat/2552-agent-projection

Conversation

@WhiteZeek

@WhiteZeek WhiteZeek commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

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 --lib test binary exceeded the 1,900 MiB build limit on this machine. Native macOS acceptance is pending. The matching desktop change pins b67ed19. 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.

Share the bounded entry index, revisioned reads, file summaries and retry validation across live sessions and loaded history pages. Refs 1lck/Lithe-IDEA#2552.
Resolve changed paths against the session directory, account for diff text in the row budget and keep retained row identities across CLI restarts.
@WhiteZeek
WhiteZeek marked this pull request as ready for review December 2, 2026 03:08
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@xiaoyumuxi xiaoyumuxi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

审了一遍,配套桌面 #2620。主要问题是 retry 的错误码一码多义、文案不准,以及恢复会话后丢行计数变小;另外两条是契约健壮性问题,眼下不会触发,需要作者确认意图。详见行内评论。

Comment thread rust/crates/agent-runtime/src/live.rs Resolved
Comment thread rust/crates/agent-runtime/src/events.rs Resolved
@xiaoyumuxi
xiaoyumuxi merged commit 7a5f633 into Lithe-IDEA:main Dec 2, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants