feat(session): add durable local delivery and isolated terminal streams - #4956
Conversation
Persist Desktop send intents and bounded read caches, recover original message identities after restart, isolate visible PTY traffic with bounded local recovery, and seed observation responses before readiness. Generated-by: Codex
Generated-by: Codex
Generated-by: Codex
Preserve single-shot Desktop shutdown and advance the combined protocol to epoch 124. Generated-by: Codex
jackwener
left a comment
There was a problem hiding this comment.
Reviewed at 7d22252eee1544a1410331c56f042356a6c41d39.
[P2] Preserve picked-file approvals until the local outbox commit succeeds
session-local:submit calls resolveIngestItems() before store.enqueue(). The former consumes every picked-file approval token, while the latter can still reject the message for the 256-record, per-message, or total outbox limit. The renderer keeps the draft when that rejection occurs, but its one-shot attachment approvals are already invalid, so retrying the unchanged draft fails and the user must select the files again.
I reproduced this through the registered production IPC handler: after filling the outbox with 256 records, a valid one-byte picked file first failed with Local message storage is full; keep the draft and resolve pending messages first; the same draft's next attempt then failed because its attachment approval had expired.
Please make approval consumption commit together with successful durable admission, or restore/reserve the approvals across every pre-admission failure. Add an IPC-level regression that fills the outbox, fails once, frees capacity, and retries the same attachment draft successfully. The aggregate 64 MiB message limit should also be checked before reading, resizing, and base64-encoding all selected files.
The focused Runtime Host continuity/PTY tests, Desktop local-store/cache/observer/PTY tests, Desktop typecheck, renderer architecture checks, and E2E budget checks passed on this head. The current-main synthetic merge is clean. I did not approve or merge because this retry failure remains unresolved.
Automated review notice: This comment was posted by an automated review agent operated by jackwener. It is not an independent human review and does not replace one.
Generated-by: Codex
|
Confirmed and fixed in Picked-file approvals are revalidated as a set and consumed only after synchronous SQLite admission succeeds. Failed preparation or admission preserves the original approvals without extending their lifetime; competing sends and sender teardown remain fenced. Aggregate source bytes are checked before file reads/resizing, with capped reads and resized-output checks covering growth during preparation. The final outbox quota check remains authoritative. Regression coverage includes the production IPC path with 256 occupied slots → failed submit → one slot freed → the unchanged attachment draft succeeds, aggregate-size rejection before resizing, and competing approval commits. Local verification: 48 focused tests, 2,355 Desktop tests, and 36 Electron tests on each of macOS and Linux pass. |
Generated-by: Codex
jackwener
left a comment
There was a problem hiding this comment.
Approved at 8112988e7630428e3a0a0aae0b3654abfbf67cc2.
The prior picked-file retry finding is closed. Approval tokens now remain valid through asynchronous preparation and are consumed only after synchronous durable outbox admission succeeds. The production IPC regression fills all 256 outbox slots, observes the failed submission, frees one slot, and successfully retries the unchanged attachment draft; aggregate attachment sizes are also rejected before file reads or resizing.
This head contains current main, the combined Astryx surface inventory matches the generator, the focused attachment/local-submit suite passes 42/42, and the Desktop main build passes after rebuilding its workspace dependency. I found no remaining merge-blocking defect in this incremental repair. Hosted checks are still running and are not represented by this approval.
Automated review notice: This comment was posted by an automated review agent operated by jackwener. It is not an independent human review and does not replace one.
English
Summary
Responsive Session interaction with Runtime Host retaining execution authority.
Delivery actions support English, Simplified Chinese, and Traditional Chinese. Edit-resend transactions retain Host-confirmed admission and draft recovery.
Verification
Electron fixture screenshots:
Compatibility and limits
AI use
Codex — implementation, tests, verification, and PR description.
Checklist
Does this PR entail a change in behavior?
简体中文
Summary
让 Session 交互及时响应,同时保留 Runtime Host 对执行的最终裁决。
投递操作提供英文、简体中文和繁体中文文案。编辑重发仍由 Host 确认接受,并保留草稿恢复语义。
Verification
Electron 测试夹具截图:
Compatibility and limits
AI use
Codex —— 实现、测试、验证及 PR 描述。
Checklist
本 PR 是否改变行为?