Skip to content

fix(agents): recognize Cline OSC titles in worktree agent rows - #13959

Open
OrcaWin wants to merge 2 commits into
stablyai:mainfrom
OrcaWin:OrcaWin/sta-3906
Open

OrcaWin wants to merge 2 commits into
stablyai:mainfrom
OrcaWin:OrcaWin/sta-3906

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Aug 12, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Cline terminals launched in Orca did not appear in worktree sidebar agent rows or the agent dashboard because the OSC title path never classified them.

Live Windows repro (cline -i via Orca terminal create) sets the pane title to exactly Cline. The npm wrapper launches through node, so expectedProcess: 'cline' process matching is not enough — title detection must fill the gap (same class of bug as Cursor in #12466).

Changes

  • Add isClineAgentTitle identity-frame gating (Cursor-style) so free-form task text mentioning "cline" does not steal Claude panes or invent idle activity
  • Map Cline → cline in TITLE_LABEL_TO_AGENT and the worktree title-derived row label map
  • Place Cline label resolution above isClaudeAgent / spinner ownership
  • Teach detectAgentStatusFromTitle to use the closed Cline identity frame (not global AGENT_NAMES) so titles like port the cline prompt stay null while Cline / Cline working / Cline - action required keep correct statuses
  • Focused regression tests: live identity title, decorated frames, task-text rejection, status null vs real frames, sidebar rows, Claude non-rebranding

Managed hooks intentionally out of scope (Cline uses SDK plugins). AI Vault remains #13840.

Test plan

  • Live Windows: orca terminal create --worktree active --command "cline -i" → orca terminal show reports title: "Cline"
  • HEAD repro: getAgentLabel('Cline') returns null without the fix
  • Non-identity mentions (port the cline prompt, ask cline later) return detectAgentStatusFromTitle(...) === null
  • Real frames: idle / working / permission / spinner / wrapper keep correct statuses
  • Focused vitest suite (224 tests) pass
  • oxlint on changed files clean
  • tsc --noEmit web + node clean
  • git diff --check clean

Fixes #13823

@coderabbitai

coderabbitai Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 41a22cf6-2161-4a82-ba0a-3cf205413fbc

📥 Commits

Reviewing files that changed from the base of the PR and between b0f6bf6 and 2edc3e6.

📒 Files selected for processing (2)
  • src/shared/agent-title-status.ts
  • src/shared/cline-title-detection.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/shared/cline-title-detection.test.ts

📝 Walkthrough

Walkthrough

Adds Cline terminal-title detection for supported identity, status, and action-required forms. Integrates Cline recognition into agent labels, agent types, Claude ownership checks, status detection, and sidebar row derivation. Adds tests for decorated titles, incidental mentions, path-like strings, Claude task text, working states, permission states, and idle Cline rows.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR addresses Cline detection, mappings, and hook deferral, but it does not show the requested exhaustiveness tests for AGENT_NAMES and TITLE_LABEL_TO_AGENT parity [#13823]. Add regression tests that assert AGENT_NAMES and TITLE_LABEL_TO_AGENT remain exhaustive and include Cline.
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Out of Scope Changes check ✅ Passed The changes remain focused on Cline OSC title detection, agent mappings, regression tests, and the documented hook deferral.
Title check ✅ Passed The title clearly identifies the main change: recognizing Cline OSC titles in worktree agent rows.
Description check ✅ Passed The description explains the problem, implementation, scope, linked issue, and testing, but it omits the required visual proof and several template sections.

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.

Live Windows `cline -i` emits the bare OSC title "Cline" while the npm
wrapper launches via node, so process recognition alone never marks the
pane as an agent. Wire Cline through identity-frame title detection and
the worktree title-derived row map so sidebar agent rows appear, without
stealing Claude task text that merely mentions cline.

Fixes stablyai#13823
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

Putting cline in the global legacy token list made detectAgentStatusFromTitle
treat ordinary mentions like "port the cline prompt" as idle agent activity.
Route Cline through isClineAgentTitle so only real identity frames produce
status, while task-text mentions stay null.

Refs stablyai#13823

This branch has not been deployed

No deployments
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.

Cline terminals don't appear in sidebar agent rows

1 participant