Skip to content

fix: stop Devin SessionStart from showing false Running spinner in sidebar - #5731

Merged
brennanb2025 merged 16 commits into
stablyai:mainfrom
thomaszdxsn:fix/devin-session-start-false-working
Jun 19, 2026
Merged

brennanb2025 merged 16 commits into
stablyai:mainfrom
thomaszdxsn:fix/devin-session-start-false-working

Conversation

@thomaszdxsn

@thomaszdxsn thomaszdxsn commented Jun 18, 2026 •

Copy link
Copy Markdown
Contributor

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

normalizeDevinEvent in src/shared/agent-hook-listener.ts mapped the SessionStart hook event to 'working' state. Devin CLI fires SessionStart the moment the TUI opens (with source: "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:

SessionStart

Fires when a new session begins. Use this for initialization, logging, or environment setup.

Field Description
source How the session was started

The source field value "startup" confirms this event fires on TUI launch, not on first user interaction.

From the Hooks Overview:

Event When it fires
SessionStart When a session begins
UserPromptSubmit When the user submits a message
PreToolUse Before a tool executes
PostToolUse After a tool finishes
Stop When the agent wants to stop
SessionEnd When a session ends

SessionStart is an initialization event, not an activity signal. UserPromptSubmit is 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":

1. SessionStart     {"source":"startup"}
2. UserPromptSubmit {"prompt":"read the file package.json..."}
3. PreToolUse       {"tool_name":"read","tool_input":{...}}
4. PostToolUse      {"tool_name":"read","tool_input":{...},"tool_response":{...}}
5. Stop             {"stop_hook_active":false}
6. SessionEnd       {"reason":"session_complete"}

SessionStart fires 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 SessionStart that clears per-turn cache state and returns null (no visible status row), matching the existing pattern used by normalizeDroidEvent and normalizeGrokEvent:

if (eventName === 'SessionStart') {
    clearPaneTurnCacheState(state, paneKey)
    return null
}

Also removed the now-dead SessionStart branch from isNewTurnEvent('devin', ...) since the early return makes it unreachable. UserPromptSubmit remains the sole new-turn boundary for Devin.

src/shared/agent-hook-listener.test.ts:

Updated the Devin lifecycle test to assert SessionStart returns null instead of { state: 'working' }.

Event mapping after fix

Hook event State Correct?
SessionStart null (no row) ✅ idle on startup
UserPromptSubmit working ✅ user submitted prompt
PreToolUse working ✅ tool executing
PostToolUse working ✅ still in same turn
PermissionRequest waiting ✅ needs user input
PostCompaction working ✅ resuming after compaction
Stop done ✅ turn complete
SessionEnd done ✅ session complete

Title-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) → detectAgentStatusFromTitle returns idle → no false spinner
  • ⠋ Devin (synthesized working title from hook) → working + spinner
  • Devin ready (synthesized done title from hook) → idle

Test plan

  • agent-hook-listener.test.ts — 41 tests pass
  • synthetic-agent-title.test.ts — 3 tests pass
  • agent-status.test.ts — 120 tests pass
  • worktree-title-derived-agent-rows.test.ts — 6 tests pass
  • oxlint — 0 warnings, 0 errors
  • Manual: open a Devin CLI terminal in Orca, confirm sidebar does NOT show Running/spinner before submitting a prompt
  • Manual: submit a prompt in Devin CLI, confirm sidebar transitions to Running with spinner

Related: potential same bug in Codex and Copilot

Code review found that two other agent normalizers still map SessionStart → 'working':

  • Codex (normalizeCodexEvent): SessionStart → 'working', and isNewTurnEvent('codex', 'SessionStart') returns true. The server tests at src/main/agent-hooks/server.test.ts explicitly assert state === 'working' for Codex SessionStart — this is tested, intentional behavior.
  • Copilot (normalizeCopilotEvent): SessionStart → 'working', and isNewTurnEvent('copilot', 'SessionStart') returns true.

Whether these constitute the same false-spinner bug depends on whether Codex/Copilot fire SessionStart on 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

nwparker and others added 16 commits June 19, 2026 02:09
…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>
@ghost

ghost commented Jun 18, 2026

Copy link
Copy Markdown

Ready to review this PR? Stage has broken it down into 2 individual chapters for you:

Title
1 Update Devin event normalization and turn logic
2 Update Devin lifecycle tests
Open in Stage

Chapters generated by Stage for commit 50f307f on Jun 18, 2026 8:07pm UTC.

@coderabbitai

coderabbitai Bot commented Jun 18, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The Devin event handling logic in agent-hook-listener.ts is adjusted so that SessionStart no longer acts as a new-turn boundary and no longer produces a visible working status row. In isNewTurnEvent, the devin branch now only treats UserPromptSubmit as a new-turn trigger. In normalizeDevinEvent, a new early return for SessionStart clears the per-pane turn cache and returns null, bypassing the state-name mapping that previously emitted a working payload. The corresponding test expectation is updated from a working payload to null, with inline comments added to explain the behavior.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is comprehensive and well-structured but does not follow the repository's required description template, missing key sections like Screenshots, Testing checklist, AI Review Report, and Security Audit. Add the missing template sections: Screenshots (with visual change confirmation), Testing checklist with pnpm commands, AI Review Report with cross-platform compatibility verification, and Security Audit summary. The existing problem/fix documentation can serve as additional context.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main fix: preventing Devin's SessionStart from incorrectly showing a Running spinner in the sidebar.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ 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.

@brennanb2025
brennanb2025 merged commit 7fa3ee1 into stablyai:main Jun 19, 2026
2 checks passed
@brennanb2025

Copy link
Copy Markdown
Contributor

Thanks for the PR!

enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…debar (stablyai#5731)

Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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.

5 participants