Skip to content

fix(devin): render fresh CLI sessions as structured chat - #2585

Merged
devswha merged 5 commits into
devswha:mainfrom
Haeminway1:fix/devin-live-session-chat
Nov 2, 2026
Merged

devswha merged 5 commits into
devswha:mainfrom
Haeminway1:fix/devin-live-session-chat

Conversation

@Haeminway1

Copy link
Copy Markdown
Contributor

Fix

Fresh Devin CLI sessions were rendered as raw terminal output because only a reported session ID or explicit --resume was accepted. On Linux, resolve the current session from the direct ACP child's exclusive kernel-backed session lock instead.

  • Bind the lock to the outer process, direct ACP child, UID, executable inode, process start, exact session-lock path and file inode.
  • Require exactly one exclusive acquired lock; reject ambiguous, stale, deleted, unlocked and conflicting evidence.
  • Re-probe before and after reading the SQLite conversation so an identity change cannot return another session's data.
  • Retain the existing Devin transcript parser and non-Linux explicit-ID route. No newest-row/cwd-only inference.
  • Add synthetic fresh-session and identity-race coverage plus a parser-to-real-ChatView Chromium regression, registered in the browser CI lane.

Base: latest fetched upstream/main 64ae5e72. Independent of the pending managed OmO PR #2565; no GJC or quota changes.

Verification

  • 217 focused tests passed (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.
  • Chromium at 1440 and 393: synthetic SQLite -> real Devin parser -> ChatView renders user/assistant/tool content, with zero terminal fallback requests.
  • 15 browser CI registration/scheduling tests passed after registering the new script.
  • Typecheck, production build, generated files and workflow syntax checks passed.
  • bun run check fast ran: 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.
  • The other seven failures are the known voice filename mismatch and six settingsHistory suite-order failures previously reproduced on clean fbb97b62. Those affected source/test files are unchanged between that baseline and 64ae5e72; no new full clean-baseline run was performed here. Nothing was suppressed.
  • Metadata-only lookup of the user's specified live pane returned source: devin-transcript with a session ID before the pane disappeared from later snapshots. No live conversation text was read. This does not establish production UI behavior.
  • Independent read-only review found no critical blocker; its requested synthetic fresh-chat test was added and passed.

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.

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: devswha/ovis
  • Branch: main
  • File: .coderabbit.yaml
  • Commit: 99a6671
  • Layers: Repository YAML
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 729b1ac2-ae38-4150-a8da-1c9bcb9e9795

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: devswha/ovis
  • Branch: main
  • File: .coderabbit.yaml
  • Commit: 99a6671
  • Layers: Repository YAML
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b78889f7-7de2-41c1-a770-07ffd262fac9
Commits

Reviewing files that changed from the base of the PR and between 99a6671 and b30bd3c.

Files selected for processing: 7
  • changelog.d/devin-live-session-chat.md
  • scripts/ci-browser.sh
  • scripts/devin-chat-browser-regression.ts
  • server/conversation.test.ts
  • server/conversation.ts
  • server/devin-session.test.ts
  • server/devin-session.ts

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

Summary

Summary by CodeRabbit

  • New Features

    • Fresh Devin CLI sessions on Linux can now open as structured conversations without a reported session ID or resume option.
    • Session identity is checked during conversation loading, helping prevent content from being shown if the active session changes.
  • Tests

    • Added browser coverage for Devin conversations on desktop and mobile, including message rendering, copy controls, and mobile overflow.
    • Added checks for session changes and unavailable or inconsistent session information.

Linux Devin sessions can resolve to structured chat using a verified session lock. Conversation reads recheck socket and pane identity. A browser regression script tests Devin chat rendering on desktop and mobile.

Changes: Devin live-session chat

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: Passed 5
Check name Status Explanation
Title check Passed 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 st…
Description check Passed 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…
Docstring Coverage Passed 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. Documentati…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
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.

Share

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.
@devswha

devswha commented Nov 2, 2026

Copy link
Copy Markdown
Owner

Thanks @Haeminway1. Review found no way for this to show another session's conversation, and it fixes a real case on main (a stale --resume after switching sessions inside Devin showed the old session). One reproduced regression and one hardening are fixed on your branch in c5c612d (main merged in first, 558c76d):

  • 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 symlink anywhere in the store path (e.g. /home on Fedora Silverblue), or no lock taken yet. Such a named session now reads as on main; a lock that is read and names another session still refuses.
  • The proof now binds the store database's device and inode too, so a sessions.db replaced between two proofs changes the binding and the read is refused.
  • Tests for both (they fail on b30bd3c), and the changelog fragment now describes the resumed-pane behaviour.

Validation: bun run check fast passed; HERDR_TEST_MODE=unit bun test server/devin-session.test.ts server/conversation.test.ts 194 pass. This touches server/, so it merges after the 0.4.22 Release run.

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.
@devswha

devswha commented Nov 2, 2026

Copy link
Copy Markdown
Owner

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 --resume session (Codex review). 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), and only that falls back to the explicitly named session; any other failure refuses. Tests cover both (the ambiguous case fails on c5c612d). bun run check fast passed.

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.
@devswha

devswha commented Nov 2, 2026

Copy link
Copy Markdown
Owner

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); bun run check fast passed.

@devswha

devswha commented Nov 2, 2026

Copy link
Copy Markdown
Owner

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 session_locks/<id>.lock (owner, inode, process start and executable checks), re-checked after the SQLite read. It also fixes a wrong-session case on main: a pane started with --resume=A whose Devin has switched to session B inside the app now falls back instead of showing A.

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 devin acp child, real kernel flock) on main vs this PR: resumed or herdr-named panes with no lock to read stay chat as on main, a stale --resume contradicted by the live lock refuses, a fresh pane with its lock opens as chat.
Fixed on the branch by the merge pass (main merged in): c5c612d a named session falls back to main's behaviour when there is no lock to read, instead of dropping to the terminal; the store database's device and inode are bound into the proof; 91a8211 only a missing lock falls back, two locks or a foreign owner refuse; 2a04f7c an unreadable child leaves the proof inconclusive. Each has a test that fails on the previous head.

  • Not changed, by the maintainer's rule that a proof which cannot run keeps main's behaviour: a symlinked store, a missing children file or an unreadable child falls back to an explicitly named session rather than refusing.
  • LOW (unrealistic, needs a same-user process tampering with Devin's own files): a held lock file renamed inside session_locks is read under its new name; a database replaced and restored within one read is not caught by the binding.
  • LOW: each read now resolves the transcript twice (extra herdr calls and /proc scans, milliseconds); the HERDR_SOCKET-changed checks guard a state the server never enters; scripts/devin-chat-browser-regression.ts passes on main too, so it does not protect this fix.

CodeRabbit's check shows skipping on this head; the merge pass reviewed it.

@devswha
devswha merged commit 56a99ba into devswha:main Nov 2, 2026
28 of 30 checks passed
devswha added a commit that referenced this pull request Nov 4, 2026
…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]>
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