Repository navigation
fix(runtime): refuse headless tab moves into a group the server doesn't have - #27381
Conversation
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
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The target-group refusal and legitimate no-op behavior have no identified issue blocking merge. Pre-merge checks |
|
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.movehandlers forsplitandmove-to-groupreplied{moved:true}when the target group didn't exist. The group builders returnnullboth for a missingtarget and for a legitimate no-op, and the handlers treated both as success.
reorderalready threwtarget_group_not_found.After:
requireHeadlessTargetGroup, holds the lookupreorderalready used: it searches the groupsthe client sees.
splitandmove-to-groupnow call it before the builder, so a missing target throwstarget_group_not_found.nullfrom the builder now only means a real no-op (a same-group drop, or splitting the last tab offits 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.movewill refuse an unknown group with the same code. Landing this now keeps the behaviourconsistent 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
New
orca-runtime-move-headless-mobile-session-tab.test.tsdrives the headless path:{moved:true}, with thestored 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
web-runtime-session-tab-move.tsunwraps 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 backinstead of silently drifting from the server.
web-runtime-terminal-create-operation.tsdoesn't unwrap the result, so it'sunaffected. The phone never calls
session.tabs.move.reorderalready returns; no new fields.