Repository navigation
fix: stop Devin SessionStart from showing false Running spinner in sidebar - #5731
brennanb2025 merged 16 commits into
Conversation
…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 <help@stably.ai>
…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.
Devin CLI SessionStart hook fires on TUI startup before the user submits any prompt. normalizeDevinEvent mapped SessionStart to working, causing the sidebar to show Devin - Running with a spinner the moment a Devin terminal opened even though the agent was idle. Fix: return null for SessionStart matching Droid and Grok behavior, clearing per-turn cache without creating a visible status row. Only UserPromptSubmit or tool activity now creates a working row. Also removed the dead SessionStart branch from isNewTurnEvent since the early return makes it unreachable. Verified against Devin CLI 2026.7.19 by capturing the actual hook event sequence. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
Ready to review this PR? Stage has broken it down into 2 individual chapters for you:
Chapters generated by Stage for commit 50f307f on Jun 18, 2026 8:07pm UTC. |
📝 WalkthroughWalkthroughThe Devin event handling logic in 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ 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. Comment |
|
Thanks for the PR! |
…debar (stablyai#5731) Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Problem
When a Devin CLI terminal opens in Orca, the sidebar immediately shows "Devin - Running" with a spinning indicator — even though the user hasn't submitted any prompt yet and the agent is completely idle.
Root Cause
normalizeDevinEventinsrc/shared/agent-hook-listener.tsmapped theSessionStarthook event to'working'state. Devin CLI firesSessionStartthe moment the TUI opens (withsource: "startup"), before any user interaction. This created a false working status row that drove the sidebar spinner, the worktree card status dot, and the dock badge count.Devin CLI documentation (verbatim)
From the Lifecycle Hooks documentation:
The
sourcefield value"startup"confirms this event fires on TUI launch, not on first user interaction.From the Hooks Overview:
SessionStartis an initialization event, not an activity signal.UserPromptSubmitis the real boundary where agent work begins.Verification
Captured the actual hook event sequence from Devin CLI 2026.7.19 using
devin --print "read the file package.json and tell me the version":SessionStartfires at step 1 with no user prompt — the agent is idle. Only at step 2 (UserPromptSubmit) does actual work begin.Fix
src/shared/agent-hook-listener.ts—normalizeDevinEvent:Add an early return for
SessionStartthat clears per-turn cache state and returnsnull(no visible status row), matching the existing pattern used bynormalizeDroidEventandnormalizeGrokEvent:Also removed the now-dead
SessionStartbranch fromisNewTurnEvent('devin', ...)since the early return makes it unreachable.UserPromptSubmitremains the sole new-turn boundary for Devin.src/shared/agent-hook-listener.test.ts:Updated the Devin lifecycle test to assert
SessionStartreturnsnullinstead of{ state: 'working' }.Event mapping after fix
SessionStartnull(no row)UserPromptSubmitworkingPreToolUseworkingPostToolUseworkingPermissionRequestwaitingPostCompactionworkingStopdoneSessionEnddoneTitle-based fallback (unchanged, verified correct)
When no hook status exists (e.g. hooks not installed), the title-derived path handles Devin correctly:
devin: orca(initial title) →detectAgentStatusFromTitlereturnsidle→ no false spinner⠋ Devin(synthesized working title from hook) →working+ spinnerDevin ready(synthesized done title from hook) →idleTest plan
agent-hook-listener.test.ts— 41 tests passsynthetic-agent-title.test.ts— 3 tests passagent-status.test.ts— 120 tests passworktree-title-derived-agent-rows.test.ts— 6 tests passRelated: potential same bug in Codex and Copilot
Code review found that two other agent normalizers still map
SessionStart→'working':normalizeCodexEvent):SessionStart→'working', andisNewTurnEvent('codex', 'SessionStart')returnstrue. The server tests atsrc/main/agent-hooks/server.test.tsexplicitly assertstate === 'working'for Codex SessionStart — this is tested, intentional behavior.normalizeCopilotEvent):SessionStart→'working', andisNewTurnEvent('copilot', 'SessionStart')returnstrue.Whether these constitute the same false-spinner bug depends on whether Codex/Copilot fire
SessionStarton idle TUI launch (like Devin) or only when a session begins with actual work. This is out of scope for this PR, which is correctly scoped to Devin. If Codex/Copilot exhibit the same false-spinner behavior, they should be addressed in separate PRs with their own hook-event verification.Generated with Devin