Skip to content

fix(runtime): refuse headless tab moves into a group the server doesn't have - #27381

Merged
Jinwoo-H merged 1 commit into
mainfrom
fix/session-tabs-refuse-unknown-group
Oct 11, 2026
Merged

Jinwoo-H merged 1 commit into
mainfrom
fix/session-tabs-refuse-unknown-group

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​99 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​99
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​18 $\color{#cf222e}{\Huge{\mathbf{−}}}$​6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​12

ELI5

When something asked a headless Orca server to move a tab into a tab group it didn't have, the server
answered "moved" and did nothing. That hid a real desktop bug (#26522). The server now says the group
wasn't found, as it already does for reordering.

What Changed

Before: the headless session.tabs.move handlers for split and move-to-group replied
{moved:true} when the target group didn't exist. The group builders return null both for a missing
target and for a legitimate no-op, and the handlers treated both as success. reorder already threw
target_group_not_found.

After:

  • One helper, requireHeadlessTargetGroup, holds the lookup reorder already used: it searches the groups
    the client sees.
  • split and move-to-group now call it before the builder, so a missing target throws
    target_group_not_found.
  • A null from the builder now only means a real no-op (a same-group drop, or splitting the last tab off
    its own group), and those still return {moved:true}.

Why

A false success is what let the desktop and server tab layouts drift apart without any error (see #26522).
The workspace-layout refactor deletes this file in its switch PR, and its translation of
session.tabs.move will refuse an unknown group with the same code. Landing this now keeps the behaviour
consistent across that switch, and surfaces drift bugs today.

Linked Issue

N/A (maintainer)

Visual Proof

N/A. Server-side error handling; no UI change.

Testing

  • Automated tests added/updated, or explained why not below

New orca-runtime-move-headless-mobile-session-tab.test.ts drives the headless path:

  • a split onto an unknown group is refused;
  • a move into an unknown group is refused;
  • a same-group drop and splitting the last tab off its own group still return {moved:true}, with the
    stored snapshot unchanged.

The two refusal tests fail without the fix. Session-tab and workspace-layout suites pass (133 tests).
tsc (node), oxlint, oxfmt and the changed-code quality gate are clean.

Notes

  • The one visible difference: the desktop's web-runtime-session-tab-move.ts unwraps the move result.
    A move into a group the server doesn't know now logs
    [web-runtime-session] failed to move tab: target_group_not_found, and the desktop rolls the move back
    instead of silently drifting from the server.
  • Other callers: web-runtime-terminal-create-operation.ts doesn't unwrap the result, so it's
    unaffected. The phone never calls session.tabs.move.
  • Wire compatibility: same error code reorder already returns; no new fields.

The headless split and move-to-group handlers answered {moved:true} when the
target group did not exist, hiding desktop/server group-id drift (#26522).
They now refuse with target_group_not_found, as reorder already does.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
@coderabbitai

coderabbitai Bot commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1fb58b76-3e03-4d09-87b4-769e96ac74cf

📥 Commits

Reviewing files that changed from the base of the PR and between 0081ea0 and 1093cc9.


📒 Files selected for processing (2)
  • src/main/runtime/orca-runtime-move-headless-mobile-session-tab.test.ts
  • src/main/runtime/orca-runtime-move-headless-mobile-session-tab.ts

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



📝 Walkthrough

Walkthrough

Headless reorder, split, and move-to-group operations now validate target groups against the public snapshot. A missing target throws target_group_not_found. Tests check missing-target errors for split and move-to-group requests, and check that same-group moves and splits of the last tab from its own group resolve as { moved: true } without changing the snapshot.


Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 1093c

The target-group refusal and legitimate no-op behavior have no identified issue blocking merge.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description check Passed The description clearly explains the problem, behavior change, rationale, linked issue exception, visual-proof rationale, tests, and compatibility impact. It omits some template sections, including Re…
Title check Passed The title is concise, specific, and accurately describes the main change: rejecting headless tab moves into groups that the server does not know.
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.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • 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

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

@Jinwoo-H
Jinwoo-H merged commit 92fb883 into main Oct 11, 2026
42 checks passed
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.

1 participant