Skip to content

fix: perf and flaky-test follow-ups from the upstream syncs - #851

Merged
trancong12102 merged 1 commit into
mainfrom
onicode/batch-0201-perf
Nov 29, 2026
Merged

trancong12102 merged 1 commit into
mainfrom
onicode/batch-0201-perf

Conversation

@trancong12102

Copy link
Copy Markdown
Contributor

Batch fix 0201, group 5: the perf items and the flaky iOS scenario from the upstream-sync follow-up queue.

Fixes

  • Active shell index covers delegatedFrom (server, perf). ProjectionStore.listActiveShellIndex reads $.delegatedFrom.environmentId, .threadId and .title, which migration 118's orchestration_v2_projection_threads_active_shell_idx did not cover, so SQLite parsed every active thread's payload. Migration 132 recreates the index with those three expressions, guarded by json_valid and identical to the query's. assertShellIndexCoversShells now runs EXPLAIN on the traced read and asserts no json_extract opcode is left. Before the migration it failed in all 9 cases, with 3 extracts.
  • One ref move refreshes VCS status once (server, perf, upstream 7f694ec917). On Linux and Windows, creating and then unlinking HEAD.lock fires two rename callbacks, and both stat as Remove HEAD.lock, so a soft reset refreshed twice. A commit refreshed once for index and again for HEAD.lock. watchHead no longer tracks event kinds (nextHeadWatch). Each event now refreshes only when checkoutState differs from what the previous event saw. checkoutState is the HEAD identity, plus stat identities of the index, packed-refs and the loose branch ref in the common directory. A repeated event for the same move sees nothing new. Every real soft reset, commit, git add, checkout or detached HEAD move changes one of those files. A refresh always starts after the state it records, so nothing a skipped event saw goes unread. The new test covers a linked-worktree layout: a repeated read, two soft resets, an index rewrite, and a branch kept only in packed-refs. The live commit/soft-reset test and the reftable tests still pass.
  • Draft branch picks stop watching (web). Each pick in BranchToolbarBranchSelector subscribed to the composer draft store and never unsubscribed. beginDraftBranchPick now holds one watcher per draft. It ends when the checkout settles (done, refused, or an early exit), when the workspace changes, or when a later pick replaces it. Two logic tests cover settling and staleness. The selector uses Promise#finally/catch rather than try/finally so React Compiler still compiles it.
  • iOS fill is no longer reported as cut off on a loaded runner (scenarios, flaky). new-task-draft-title-keeps-whole-characters failed three times on the self-hosted runner with ACTION_FAILED: fill timed out before the device answered; its input may have been dispatched. Every step of a fill shares one 30 s action budget, and once the fill is sent it answers within max(remaining, 250 ms). When snapshots on a busy host use up most of the budget, the 96-character type-and-verify loses the race, and the result is a non-retryable ACTION_MAY_HAVE_COMMITTED. Our @e2e-dev/mobile patch now gives fill and clear an answer time sized to the text once sent, 5 s + 100 ms per character. The test timeout still caps it.

Verification

  • vp run check:changed: all green (format, lint, knip, typecheck, 92 test files, React Compiler).
  • Base failures:
    • ProjectionStore: 9 failures before migration 132.
    • checkoutState and beginDraftBranchPick tests: the functions don't exist on main.
  • iOS proof on a local simulator, with --action-timeout 2500 to make the load deterministic: the base patch fails with the exact CI error (fill timed out before the device answered…), and this patch passes. It also passes at the default and at 4 s.
  • Real-client pass of peer subagent Stop, carried as a leftover since batch 1055:
    • Two dev environments on this machine, linked with onicode environment link.
    • A Haiku parent on A delegated a Replay question child to B.
    • Desktop: Stop on the Lineage remote row interrupted the child on B, and the parent recorded "Delegated task … stopped".
    • Mobile: Agents sheet → Stop → confirm turned the row into "Interrupted · Stopped." and interrupted the child on B.
    • No code change was needed.

Council review

Not run. Antigravity reports model_unavailable for gemini-4-neon, which it doesn't advertise (offered: gemini-4-hydrogen, gemini-3.8-flash, claude-opus-5-5, claude-sonnet-5-5, gpt-oss-120b-medium). The batch rules don't allow switching the reviewer model, so this is an external limit.

Implemented by Claude Opus 5.5 in Claude Code (Onicode).

🤖 Generated with Claude Code

- server: migration 132 adds the delegatedFrom fields to the active shell index, so
  listActiveShellIndex parses no thread payload.
- server: one ref move refreshes VCS status once. The HEAD watch compares HEAD, the branch
  ref, packed-refs and the index instead of event kinds, so Linux's two HEAD.lock Removes
  and a commit's index plus HEAD.lock no longer refresh twice.
- web: a draft branch pick stops watching the draft once it settles, instead of leaving a
  store subscription per pick.
- scenarios: an iOS fill gets an answer time sized to its text once sent, so a loaded runner
  no longer reports a landed fill as cut off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@trancong12102
trancong12102 merged commit 3c132ed into main Nov 29, 2026
18 checks passed
@trancong12102
trancong12102 deleted the onicode/batch-0201-perf branch November 29, 2026 00:23
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