Repository navigation
fix(devin): render fresh CLI sessions as structured chat - #2585
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
| Layer / File(s) | Summary |
|---|---|
Live Devin session proof server/devin-session.ts, server/devin-session.test.ts, changelog.d/devin-live-session-chat.md |
Session resolution validates the Devin process and its direct ACP child’s kernel lock. Pane selection uses the live session ID when it does not conflict with explicit identity. Tests cover invalid proofs and conflicting identities. |
Conversation identity checks server/conversation.ts, server/conversation.test.ts |
Transcript resolution includes the herdr socket and Devin lock proof. Reads reject changes to the socket or resolved pane identity. Tests cover identity changes during discovery and reads. |
Devin chat browser regression scripts/devin-chat-browser-regression.ts, scripts/ci-browser.sh |
A browser test serves a synthetic Devin conversation and checks chat rendering at desktop and mobile widths. The browser CI lane runs the test. |
Estimated code review effort: 4 (Complex) | ~45 minutes
Change: Bug fix
Possibly related PRs
- devswha/ovis#1765 introduced
devinSessionForPane, which this PR extends with live lock proof and conversation identity checks.
Suggested reviewers: devswha
Merge Risk: 
Minimal · previous review b30bd
-
The fresh-session test covers live-proof resolution without a reported session ID. No established issue remains that should block merging after normal checks.
Pre-merge checks: 
5
-
Full details: Title check
-
Explanation
The title "fix(devin): render fresh CLI sessions as structured chat" matches the main change: fresh Devin CLI sessions on Linux now resolve through the direct ACP child's session lock and render as structured chat instead of raw terminal output. It is concise, specific, and follows a conventional-commit style. It does not name the Linux-only lock mechanism, but it does not need to cover every detail.
Full details: Description check
-
Explanation
The description follows the repository template. The Change section explains the problem (fresh Devin CLI sessions rendered as raw terminal output), the resulting behavior, and the scope and limits of the fix. The Validation section lists the commands run (
bun run check fast, typecheck, build, focused tests, and browser regression), their results, the seven unrelated failures, and the checks not run. It also links to the changelog implicitly by listing the changelog-related context, but it does not explicitly reference CONTRIBUTING.md or name the changelog.d entry. It does not link a maintainer-agreed issue, though the template asks for one only for features, and this is a fix. The description is thorough and mostly complete.
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 5 functions across 6 files. (1 skipped: 1 unsupported.)
-
Finishing Touches
-
Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
On Linux the lock proof ran for every Devin pane and threw when it could not read a lock, so a --resume=<id> or herdr-reported session that opens as chat on main fell back to the terminal (an older Devin without session_locks, a symlinked store path, no lock taken yet). Such a session now reads as on main; a lock that is read and names another session still refuses. The proof also binds the store database's device and inode, so a database replaced between two proofs changes the binding and the read is refused. Tests cover both and fail on the previous head.
|
Thanks @Haeminway1. Review found no way for this to show another session's conversation, and it fixes a real case on main (a stale
Validation: |
The fallback to an explicitly named session took every proof failure as absence, so two held locks or a foreign owner still read the --resume session. devinLockProof now throws DevinLockMissing only when there is no lock to read (no session_locks, a symlinked store, no children file, no lock held yet); any other failure refuses, as before the fallback.
|
One more on your branch, 91a8211: the fallback from c5c612d took every lock-proof failure as "no lock", so two held locks or a foreign owner still read the |
A child of the Devin process that could not be read was skipped, so a readable ACP's lock still made a proof even though the unread child might hold another. An unread child now leaves the proof inconclusive (DevinLockMissing); two or more locks still refuse first.
|
And 2a04f7c: a child of the Devin process that could not be read was skipped, so a readable ACP's lock still made a proof though the unread child might hold another lock. An unread child now leaves the proof inconclusive (falls back only to an explicitly named session); two or more locks still refuse first. Test included (fails on 91a8211); |
|
Merging after the 0.4.22 Release run with credit to @Haeminway1. A fresh Devin CLI session on Linux opens as structured chat without a reported session ID or a resume argument: the session is read from the exclusive lock the Devin process's own ACP child holds on Merge-pass review (wrong-session rule): omo code reviewer and Codex Terra xhigh on the PR and each round; the reviewer's real-process harness (real
CodeRabbit's check shows skipping on this head; the merge pass reviewed it. |
…2701) ## Change Based on #2565 by @Haeminway1 (co-authored); this takes its standalone server parts. - **OmO full tool output:** `transcriptToolOutput` had no OmO branch, so an OmO pane's "show the whole output" read the entire session file (`readFileSync`) and scanned it as text. It now looks only in the latest transcript window (16 MiB, the same `windowStart` the command-history reader uses), skips a record only when the window starts inside it, resets at a `context_clear`, and caps the answer at the existing 2,000,000 characters. An older call's output outside the window can be unavailable. - **Devin diagnostic:** a Devin pane with no session lock and no reported or resumed id now carries the bounded diagnostic `devin_current_session_unverified` (through `ConversationDiagnostics`, rate-limited like the Copilot ones). The reason sent to clients stays `no_session_id`, so no HTTP contract changes. #2565's rename of the wire reason was not taken: #2585 has since changed this code, and a diagnostic says the same without a new client-visible code. ## Why Reproduced on main: the three new OmO output tests fail there (no tail bound, no context-clear reset, reads past the window), and the new Devin test fails (no diagnostic). ## Validation - `bun test server/conversation.test.ts server/conversation-diagnostics.test.ts`: 203 pass, 0 fail. - New tests fail on origin/main (12a7c63): 3 OmO output tests, 1 Devin diagnostic test. - `bun run check fast`: passed (workflow syntax, generated types/themes, typecheck, build, unit tests). origin/main currently fails typecheck in `server/herdr-core/adapter.ts`; #2693's two-line fix was applied locally for this run only and is not part of this PR. - Codex (Terra) adversarial review of the OmO part: no HIGH. Fixed: a complete record starting exactly at the window boundary was skipped (new regression test). Not changed: the window start rounds up to a 64 KiB chunk like the other transcript windows; a record over 4 MiB whose shape cannot be read inside the window makes the lookup answer `null` (fails closed) instead of scanning past it. Co-authored-by: Haemin <[email protected]>
Fix
Fresh Devin CLI sessions were rendered as raw terminal output because only a reported session ID or explicit
--resumewas accepted. On Linux, resolve the current session from the direct ACP child's exclusive kernel-backed session lock instead.Base: latest fetched upstream/main
64ae5e72. Independent of the pending managed OmO PR #2565; no GJC or quota changes.Verification
devin-session,devin,conversation). Includes a fresh pane with no reported/resume ID returning actual synthetic question/answer turns, and rejection when identity changes before return.bun run check fastran: 10541 passed, 41 skipped, 8 failed. One failure was the new browser script missing from the CI lane; fixed and the focused CI tests now pass. The full fast suite was not repeated after that one-line registration fix.fbb97b62. Those affected source/test files are unchanged between that baseline and64ae5e72; no new full clean-baseline run was performed here. Nothing was suppressed.source: devin-transcriptwith a session ID before the pane disappeared from later snapshots. No live conversation text was read. This does not establish production UI behavior.Not run: full integration/Windows/WebKit/device checks. Existing Node-version/build warnings remain.
Limits and rollout
This supports the observed Linux Devin 3000.11.234 direct-ACP lock layout. A missing or conflicting proof fails closed. An explicit startup/reported ID conflicting with a newly held session is rejected; automatic rendering after every CLI in-process switch is not claimed. Account quota is not part of this repair.
No production service or agent was restarted, and no live prompts were sent. This PR does not authorize automatic deployment or merge.
Implemented with AI assistance; checks above were run by the submitting agent.