Skip to content

feat(devin): managed hooks, sleeping resume, AI Vault - #5380

Merged
Jinwoo-H merged 23 commits into
stablyai:mainfrom
thomaszdxsn:feat/devin-deep-integration
Jun 18, 2026
Merged

Jinwoo-H merged 23 commits into
stablyai:mainfrom
thomaszdxsn:feat/devin-deep-integration

Conversation

@thomaszdxsn

@thomaszdxsn thomaszdxsn commented Jun 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #5282 (merged into v1.4.68), which added baseline Devin CLI support (catalog entry, stdin-after-start, --permission-mode bypass, startup tests).

This PR adds the remaining deep integration for Devin as a first-class TUI agent: managed hooks, sleeping-agent resume, AI Vault session scanning, and UI polish.

Closes #5246 (full scope).


What's in this PR

Managed hooks

  • src/main/devin/ — hook-settings.ts (config path, %APPDATA% Windows fallback), hook-service.ts (install/remove/status/installRemote), hook-config-json.ts (JSONC via jsonc-parser)
  • Managed script POSTs to /hook/devin; normalizeDevinEvent in agent-hook-listener.ts
  • Preload: devinStatus() IPC bridge (src/preload/index.ts, api-types.ts)
  • Remote fix: installRemote uses parseJsonc instead of JSON.parse (Devin config.json is JSONC)

Sleeping-agent resume

  • devin in RESUMABLE_TUI_AGENTS; getAgentResumeArgv('devin', ...) returns ['devin', '--resume', id]
  • extractAgentProviderSession('devin') reads session_id / sessionId from transcript

UI polish

  • devin added to: title-agent-identity.ts, general-search.ts, worktree-title-derived-agent-rows.ts, use-tab-agent.ts, agent-completion-coordinator.test.ts
  • i18n: 5 locale files (en/es/ja/ko/zh)

AI Vault

  • devin in AI_VAULT_AGENTS; session-scanner-devin-parser.ts parses ATIF JSON transcripts
  • Discovers ~/.local/share/devin/cli/transcripts (or DEVIN_HOME); builds devin --resume copy commands

Code review fixes

  • P1: Remote install now uses parseJsonc (was JSON.parse) — SSH users with comments in ~/.config/devin/config.json would see silent parse failures
  • P2: Added partial status test + Windows APPDATA config path test

Context

Item Link
Issue #5246 — Add Devin CLI as a supported agent
Baseline PR #5282 — merged by @Jinwoo-H into v1.4.68 (74e2c952f)
Baseline scope Catalog entry, stdin-after-start, --permission-mode bypass, startup tests
This PR scope Hooks / resume / AI Vault / UI polish

Verification

  • tsgo --noEmit across all 3 tsconfigs: pass
  • 59 tests passed across src/main/devin/, src/main/ai-vault/session-scanner*, src/shared/agent-session-resume.test.ts, src/shared/tui-agent-startup.test.ts
  • No local devin CLI available (consistent with feat: add Devin CLI as supported TUI agent #5282 reviewer note); PTY E2E requires manual QA after install

@coderabbitai

coderabbitai Bot commented Jun 15, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This pull request integrates the Devin CLI as a fully supported agent in Orca. It registers devin in all relevant shared type unions (AgentHookTarget, AgentHookSource, RESUMABLE_TUI_AGENTS, AI_VAULT_AGENTS), introduces a DevinHookService class with JSONC config parsing (via a new jsonc-parser dependency), local/remote hook script generation, and install/remove/status lifecycle. Devin is wired into managed and remote hook installer/remover/status-reader arrays and exposed through a new agentHooks:devinStatus IPC channel and preload bridge. A new hook listener normalizer maps Devin lifecycle events to Orca status payloads via /hook/devin. The AI Vault gains Devin transcript discovery and a session parser extracting model, tokens, messages, and titles from step records. Claude hook scripts are updated to emit an early-exit guard when DEVIN_PROJECT_DIR is set. Renderer identity lookups, title detection, synthetic terminal titles, and settings search are extended to recognize Devin, and workspace session schema hydration is updated to preserve the new origin: 'live' value.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 8.51% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main changes: managed hooks, sleeping resume, and AI Vault integration for Devin support.
Description check ✅ Passed Description covers all required sections: Summary, Screenshots (N/A), Testing checklist, AI Review Report, Security Audit, and Notes.
Linked Issues check ✅ Passed All requirements from #5246 are met: Devin is now a first-class agent with managed hooks, resume capability, AI Vault support, and UI integration.
Out of Scope Changes check ✅ Passed All changes are scoped to Devin integration objectives. No unrelated modifications to unrelated systems detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 4

🧹 Nitpick comments (1)
src/main/devin/hook-settings.ts (1)

30-31: ⚡ Quick win

Use Node path utilities for remote path composition.

Line 31 hardcodes / in a constructed path. Please switch this to path.posix.join(...) and mirror the same approach for the remote script path construction in src/main/devin/hook-service.ts (Line 195).

As per coding guidelines, "Use path.join or Electron/Node path utilities for file paths — never assume / or \ for cross-platform compatibility".

♻️ Suggested patch
-import { join } from 'path'
+import { join, posix as pathPosix } from 'path'
...
 export function getDevinRemoteConfigPath(remoteHome: string): string {
-  return `${remoteHome.replace(/\/$/, '')}/.config/devin/config.json`
+  return pathPosix.join(remoteHome, '.config', 'devin', 'config.json')
 }

Source: Coding guidelines


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 85bad9e0-2f7b-48e2-ae77-162a6a03d43f

📥 Commits

Reviewing files that changed from the base of the PR and between 98806ff and 98f8fae7425ee0e208bc1e3fc99393b05a7e6df1.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (37)
  • config/tsconfig.cli.json
  • package.json
  • plans/001-add-devin-cli-agent.md
  • plans/002-devin-managed-agent-hooks.md
  • plans/003-devin-sleeping-agent-resume.md
  • plans/004-devin-ui-polish-and-completion.md
  • plans/005-devin-ai-vault-spike.md
  • plans/README.md
  • src/main/agent-hooks/managed-agent-hook-controls.ts
  • src/main/agent-hooks/remote-managed-hook-installers.ts
  • src/main/ai-vault/session-scanner-devin-parser.test.ts
  • src/main/ai-vault/session-scanner-devin-parser.ts
  • src/main/ai-vault/session-scanner-types.ts
  • src/main/ai-vault/session-scanner.test.ts
  • src/main/ai-vault/session-scanner.ts
  • src/main/devin/hook-config-json.test.ts
  • src/main/devin/hook-config-json.ts
  • src/main/devin/hook-service.test.ts
  • src/main/devin/hook-service.ts
  • src/main/devin/hook-settings.ts
  • src/main/ipc/agent-hooks.test.ts
  • src/main/ipc/agent-hooks.ts
  • src/preload/api-types.ts
  • src/preload/index.ts
  • src/renderer/src/components/settings/general-search.ts
  • src/renderer/src/components/sidebar/worktree-title-derived-agent-rows.ts
  • src/renderer/src/components/terminal-pane/agent-completion-coordinator.test.ts
  • src/renderer/src/components/terminal-pane/title-agent-identity.ts
  • src/renderer/src/lib/use-tab-agent.ts
  • src/renderer/src/web/web-preload-api.ts
  • src/shared/agent-hook-listener.ts
  • src/shared/agent-hook-relay.ts
  • src/shared/agent-hook-types.ts
  • src/shared/agent-session-resume.test.ts
  • src/shared/agent-session-resume.ts
  • src/shared/ai-vault-types.ts
  • src/shared/tui-agent-config.ts

Comment thread src/main/ai-vault/session-scanner.ts Resolved
Comment thread src/main/devin/hook-config-json.ts Resolved
@thomaszdxsn
thomaszdxsn force-pushed the feat/devin-deep-integration branch 3 times, most recently from 3805de8 to 279539d Compare June 15, 2026 12:48
@thomaszdxsn

Copy link
Copy Markdown
Contributor Author

@Jinwoo-H All 4 CodeRabbit inline comments have been addressed in the latest push (279539dfa):

Finding Fix
🟠 Major: sessionId dual lookup Added record.sessionId fallback (matches grok/claude parsers)
🟠 Major: parseJsonc silent errors Now collects ParseError[] → console.warn on non-empty → return null
🟡 Minor: DEVIN_TRANSCRIPTS_DIR comment Added // Why: rationale
🟡 Minor: i18n namespace Restored original auto.lib.agent.catalog.fc80296033 key (exists in all 5 locales)

CodeRabbit's inline comments are pinned to an older commit and haven't re-scanned, but the diffs in 279539dfa cover all four.

When you have time, a light re-review would be appreciated. No rush — happy to squash or split if you prefer.

@Jinwoo-H
Jinwoo-H requested review from Jinwoo-H and removed request for brennanb2025 June 17, 2026 23:11

@Jinwoo-H Jinwoo-H 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.

Thanks for the PR. I found and fixed a few integration edge cases before landing:

  • tightened Devin JSONC parsing and managed hook event/matcher handling
  • prevented imported Claude hooks from double-posting inside Devin
  • added Devin-aware status/title detection across local and remote paths
  • filled AI Vault and sleeping-session compatibility gaps
  • added focused coverage for hook config, parsing, titles, resume, and SSH/remote status handling

Validated with typecheck, lint, relay build, focused Vitest, Electron UI verification, and a Docker-backed SSH relay round trip.

@ghost

ghost commented Jun 18, 2026 •

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/main/devin/hook-settings.ts (1)

47-49: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Use Node path utilities for remote config path construction.

Line 48 hardcodes / via string interpolation. This bypasses centralized path normalization and violates the repo’s cross-platform path construction rule.

🛠️ Suggested fix
diff --git a/src/main/devin/hook-settings.ts b/src/main/devin/hook-settings.ts
@@
-import { join } from 'path'
+import { join, posix as pathPosix } from 'path'
@@
 export function getDevinRemoteConfigPath(remoteHome: string): string {
-  return `${remoteHome.replace(/\/$/, '')}/.config/devin/config.json`
+  const normalizedHome = remoteHome.replace(/\/+$/, '') || '/'
+  return pathPosix.join(normalizedHome, '.config', 'devin', 'config.json')
 }

As per coding guidelines, “Use path.join or Electron/Node path utilities for file paths — never assume / or \ for cross-platform compatibility.”

Source: Coding guidelines

🧹 Nitpick comments (1)
src/shared/agent-hook-listener.ts (1)

3019-3019: ⚡ Quick win

Add direct route coverage for the new Devin endpoint.

Line 3019 introduces a new path mapping, but the route-resolution test list doesn’t explicitly assert '/hook/devin'. A single assertion would prevent silent regressions.

🧪 Suggested test addition
diff --git a/src/shared/agent-hook-listener.test.ts b/src/shared/agent-hook-listener.test.ts
@@
     expect(resolveHookSource('/hook/grok')).toBe('grok')
     expect(resolveHookSource('/hook/hermes')).toBe('hermes')
+    expect(resolveHookSource('/hook/devin')).toBe('devin')
     expect(resolveHookSource('/hook/pi')).toBe('pi')

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: b440d785-76f2-48a7-940d-f131d003329c

📥 Commits

Reviewing files that changed from the base of the PR and between 279539dfa8876e3cd1e60e8ab5edd1d6a1ec6eaf and 5ce885511eabb1606672466c289a1f800cdd49b9.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (30)
  • package.json
  • src/main/agent-hooks/remote-hook-service-installers.test.ts
  • src/main/ai-vault/session-scanner-agent-parser.ts
  • src/main/ai-vault/session-scanner-devin-parser.test.ts
  • src/main/ai-vault/session-scanner-devin-parser.ts
  • src/main/ai-vault/session-scanner.ts
  • src/main/claude/hook-service.test.ts
  • src/main/claude/hook-service.ts
  • src/main/devin/hook-config-json.test.ts
  • src/main/devin/hook-config-json.ts
  • src/main/devin/hook-service.test.ts
  • src/main/devin/hook-service.ts
  • src/main/devin/hook-settings.ts
  • src/renderer/src/components/terminal-pane/pty-connection.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection.ts
  • src/renderer/src/components/terminal-pane/title-agent-identity.test.ts
  • src/renderer/src/components/terminal-pane/title-agent-identity.ts
  • src/renderer/src/lib/agent-status-terminal-title.test.ts
  • src/renderer/src/lib/agent-status.test.ts
  • src/renderer/src/lib/resume-sleeping-agent-session.test.ts
  • src/renderer/src/lib/resume-sleeping-agent-session.ts
  • src/shared/agent-detection.ts
  • src/shared/agent-hook-listener.test.ts
  • src/shared/agent-hook-listener.ts
  • src/shared/agent-name-token-match.ts
  • src/shared/agent-session-resume.ts
  • src/shared/synthetic-agent-title.test.ts
  • src/shared/synthetic-agent-title.ts
  • src/shared/workspace-session-schema.test.ts
  • src/shared/workspace-session-schema.ts
✅ Files skipped from review due to trivial changes (3)
  • src/renderer/src/components/terminal-pane/title-agent-identity.test.ts
  • src/shared/synthetic-agent-title.ts
  • src/main/claude/hook-service.test.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • package.json
  • src/main/devin/hook-service.test.ts
  • src/main/devin/hook-service.ts

@Jinwoo-H Jinwoo-H 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.

Re-approved after resolving the merge conflict and repairing the base test drift that failed verify.

nwparker and others added 16 commits June 17, 2026 18:07
…tablyai#1302)

Clicking a worktree card whose row lies outside the sidebar viewport
caused an instant jump when scrolling it into view. Switching
`scrollToIndex` to `behavior: 'smooth'` turns that minimum-distance
scroll into an animated slide while keeping `align: 'auto'` so visible
cards still no-op (no re-centering).

Co-authored-by: Orca <[email protected]>
…i#4815)

The cut job checks out main, bumps package.json's version, and
fast-forwards main. On a fork with Actions enabled, the scheduled RC
cut runs against the fork's main and diverges it on the version line
every slot, so that contributor's PRs back to upstream conflict on
package.json even when their change never touches it.

Gate the job to github.repository == 'stablyai/orca' so it (and the
jobs that depend on it) no-op on forks. Canonical scheduled and manual
cuts are unaffected.
thomaszdxsn and others added 7 commits June 17, 2026 18:07
- Parse Devin config.json as JSONC; warn on read_config_from overlap
- Windows hook command uses forward slashes; APPDATA fallback
- Add devin to sleeping-agent resume and UI registries (plan 003/004)
- Add hook-service and hook-config-json tests

Closes follow-up for plans 002–004 on feat/add-devin-agent.
Register devin in AI_VAULT_AGENTS, discover ~/.local/share/devin/cli/transcripts
(or DEVIN_HOME), parse ATIF JSON sessions, and build devin --resume commands.
- installRemote: replace readHooksJsonRemote (JSON.parse) with
  readTextFileRemote + parseJsonc for JSONC compatibility on SSH
- Add partial status test (some hooks missing → state:'partial')
- Add Windows APPDATA config path test with fallback
@Jinwoo-H
Jinwoo-H force-pushed the feat/devin-deep-integration branch from 7708cba to 5fa0711 Compare June 18, 2026 01:10
@Jinwoo-H
Jinwoo-H merged commit 08ba730 into stablyai:main Jun 18, 2026
4 checks passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
* Revert "fix(terminal): add proportional scroll fallback for sidebar resize" (stablyai#937)

* fix(sidebar): smoothly animate off-screen worktree reveal on click (stablyai#1302)

Clicking a worktree card whose row lies outside the sidebar viewport
caused an instant jump when scrolling it into view. Switching
`scrollToIndex` to `behavior: 'smooth'` turns that minimum-distance
scroll into an animated slide while keeping `align: 'auto'` so visible
cards still no-op (no re-centering).

Co-authored-by: Orca <[email protected]>

* Avoid local scrollback serialization on shutdown (stablyai#1821)

* Fix PR refresh coordinator test arguments (stablyai#2545)

* release: v1.4.31

* release: v1.4.31

* release: v1.4.31

* release: v1.4.31

* release: v1.4.31

* release: v1.4.31

* release: v1.4.31

* release: v1.4.36-rc.6

* release: v1.4.36-rc.6

* release: v1.4.36-rc.6

* ci: gate release-cut to the canonical repo so it skips forks (stablyai#4815)

The cut job checks out main, bumps package.json's version, and
fast-forwards main. On a fork with Actions enabled, the scheduled RC
cut runs against the fork's main and diverges it on the version line
every slot, so that contributor's PRs back to upstream conflict on
package.json even when their change never touches it.

Gate the job to github.repository == 'stablyai/orca' so it (and the
jobs that depend on it) no-op on forks. Canonical scheduled and manual
cuts are unaffected.

* feat(hooks): install Devin managed status hooks

* feat(devin): address hook review, resume, and UI polish

- Parse Devin config.json as JSONC; warn on read_config_from overlap
- Windows hook command uses forward slashes; APPDATA fallback
- Add devin to sleeping-agent resume and UI registries (plan 003/004)
- Add hook-service and hook-config-json tests

Closes follow-up for plans 002–004 on feat/add-devin-agent.

* feat(devin): scan ATIF transcripts for AI Vault

Register devin in AI_VAULT_AGENTS, discover ~/.local/share/devin/cli/transcripts
(or DEVIN_HOME), parse ATIF JSON sessions, and build devin --resume commands.

* docs(devin): clarify stdin-after-start vs bracketed paste

* fix(devin): use JSONC for remote install, add partial+APPDATA tests

- installRemote: replace readHooksJsonRemote (JSON.parse) with
  readTextFileRemote + parseJsonc for JSONC compatibility on SSH
- Add partial status test (some hooks missing → state:'partial')
- Add Windows APPDATA config path test with fallback

* fix(devin): address CodeRabbit review — sessionId fallback, parseJsonc errors, comment, i18n

* Fix Devin integration edge cases

Co-authored-by: Orca <[email protected]>

* Package Devin JSONC parser dependency

Co-authored-by: Orca <[email protected]>

---------

Co-authored-by: Neil <[email protected]>
Co-authored-by: Brennan Benson <[email protected]>
Co-authored-by: Orca <[email protected]>
Co-authored-by: Jinjing <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Trevin Chow <[email protected]>
Co-authored-by: Jinwoo-H <[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.

[Feature Request] Add Devin CLI as a supported agent

6 participants