Skip to content

Keep Antigravity model labels current - #46309

Draft
brennanb2025 wants to merge 5 commits into
mainfrom
brennanb2025/antigravity-root-model
Draft

brennanb2025 wants to merge 5 commits into
mainfrom
brennanb2025/antigravity-root-model

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

The sidebar could keep an older model label after a new turn. It now shows the model reported for the current turn and preserves an explicit selection.

Files Added Deleted Net
Test 12 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1755 $\color{#cf222e}{\Huge{\mathbf{−}}}$​4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1751
Prod 74 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2157 $\color{#cf222e}{\Huge{\mathbf{−}}}$​722 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1435

What Changed

Resolve the accepted root row from incremental transcript reads with turn and owner fences. Share bounded read scheduling on main and relay, stop obsolete reads, resume after spool replay and hook re-enable, and skip plugin terminal inventory for model-only changes when the visible event facts are unchanged.

Why

The sidebar should identify the model doing the work without stale reads changing another turn or pane.

Linked Issue

Tracked in #43692. Independent prerequisite for #45054; carries community work with contributor credit.

Visual Proof

Current-head real-agent screenshots are pending.

Testing

  • Real-agent QA complete.
  • Added current-turn, explicit-model, ownership, replay and bounded-read contracts.
  • Final checks, revert controls and CI pass.

Published head 458a6bfca7c4a446d42bb715860b9de1fec59d5b passed 81 selected cases in 13 files. A newer local repair draft, 2d20fc98725c89aad06c08c0aa6fa0990a346c41, passed 103 selected cases in 14 files; that repair is not yet the published head. Real native default-model turns, explicit selection, pane replacement and hooks toggling passed on the local draft. Saved-session restart and a successful real Codex command are still owed.

The native CLI has no supported Auto-model selector. Unresolved-model resolution, completion fallback and model-only IPC are defensive paths covered by the owning-layer deterministic fault/IPC contracts; the real runs received concrete models in their initial hooks and do not claim live coverage of those paths. Final integration, audit, performance review, checks and CI remain pending.

Performance

Performance remains blocked on the remaining provenance-admission and renderer-inventory findings. Selected root-model contracts pass81 cases across13 files on458a6bfca7c4a446d42bb715860b9de1fec59d5b, including incremental reads and phone-catalog suppression. These results do not establish a full performance pass or runtime CPU, elapsed-time or heap measurements. Final repairs and review are pending.

Risk

Level: Medium

Incorrect ownership or turn ordering could show a stale model. Shared polling changes can affect other terminal agents and remote hosts. Existing saved data stays readable; a plain revert restores prior behavior.

AI Disclosure

Review

Draft. The independent audit found a pending-completion regression and per-cancellation global queue scans. The full performance scan found renderer fanout, repeated tail reads, stalled I/O/lease cleanup and raw replay retention. Confirmed blockers are being repaired; final verification remains pending.

Agent skill upstream boundary

  • Not applicable; no upstream skill-installer content is copied.

Notes

Planned validation covers local and relayed execution, folder workspaces, consecutive turns, hook toggling, dismissal and restart. Current runtime evidence is limited to the flows listed above.

Checklist

  • One current-turn model reporting change.
  • User-facing behavior and mechanism explained.
  • Risks and revert behavior stated.
  • Current visual proof attached.
  • Correctness, security and performance review complete.
  • Cross-platform, remote and mobile compatibility considered.
  • Checks and CI pass.

@brennanb2025

brennanb2025 commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor Author

Performance gate: FAIL at 458a6bfca7c4a446d42bb715860b9de1fec59d5b. The earlier metadata fanout, growing-tail and redelivery repairs pass the selected regression cases. This fresh full scan identifies remaining findings. Update: the finder explicitly withdrew finding 3 after confirming the intended discovery contract: ten bounded acquisition attempts per eligible unresolved root within thirty minutes, then zero. No watcher or indefinite polling is required. Findings 1 and 2 remain blocking. The original report below is retained with that correction.

Three source-proven performance regressions block this span. No tests, checks, builds, apps, edits, delegates, or external posts were run.

  1. P1 — Transcript provenance is now read before the conversation-ID skip gate.
    Introducing line: pane-provider-session.ts:41.

    Concrete input: a valid PreToolUse hook with transcriptPath and lastUserInput, but no conversation ID. Base returns from provider-session extraction before reading provenance. Target calls readFirstTranscriptRecord first, although model observation subsequently rejects the missing ID.

    This newly reaches synchronous openSync/readSync on Electron main and the relay event loop. Each hook reads up to 4 MiB, in 64 KiB chunks, without a fingerprint cache or the new asynchronous read-slot budget.

    At two hooks/second/pane:

    Input 100 panes 1,000 panes
    First newline within a 64 KiB read 200 synchronous reads/s; up to 12.5 MiB/s 2,000 reads/s; up to 125 MiB/s
    Unfinished first record ≥4 MiB 12,800 synchronous reads/s; 800 MiB/s 128,000 reads/s; 8,000 MiB/s

    Worktree count does not reduce this cost. The result is unused for this input. Restore admission before I/O while preserving provenance classification for eligible identities.

    Required guard: missing-ID hooks perform zero provenance filesystem operations; eligible root/child/unknown inputs retain their intended behavior. The inspected ownership test instruments asynchronous filesystem reads, so its missing-ID case does not cover this synchronous path.

  2. P1 — Model-only publication still invalidates unchanged renderer inventories.
    Introducing publication: server-status-row-mutation.ts:30.

    Concrete input: one accepted automatic root resolves its model, with pane ownership, state, evidence clocks, routing, and orchestration unchanged. The resulting desktop event replaces the accepted-status handle. Several unchanged consumers still key expensive work on that handle:

    • Orchestration attribution: worktree-agent-orchestration-index.ts:87 misses its cache, visits every orchestration context, allocates three attribution entries/context, then compares the entire unchanged result. Reachable through sidebar lineage-slot snapshots with nonempty orchestration.
    • Open dashboard drawer: useLiveDashboardSnapshot.ts:20 reruns snapshot construction. The builder walks active workspaces and recopies card collections, although the serialized DashboardCard contains no model field.
    • Visible session history: ai-vault-original-pane-actions.ts:39 replaces the lazy original-pane index. The first visible session-row lookup rebuilds live, conversation, and sleeping-session indexes; none consumes model metadata.

    Price per separately delivered/rendered resolution:

    Consumer Reference population 10× population
    Orchestration attribution 100 contexts visited; 300 attribution entries produced and compared 1,000 contexts; 3,000 entries
    Dashboard 750 workspace visits plus 100 card references 7,500 workspace visits plus 1,000 card references
    History lookup 100 + C + S indexed records 1,000 + C + S indexed records

    Here C and S are retained conversations and sleeping sessions, independently of transcript bytes. At one committed model resolution/second, these are the corresponding per-second counts; bursts may coalesce through React. The shared orchestration cache prevents multiplying its scan by every mounted card, but does not eliminate the scan.

    These loops predate the span; the automatic metadata publication introduces their additional trigger. The newly added revisions protect several other consumers but leave these inventories exposed.

    Required guard: mount these production consumers at both populations, resolve one model, and assert zero unrelated inventory visits/rebuilds. Real ownership, state, freshness, and membership changes must still invalidate them.

  3. P1 — Unresolved quiet owners introduce background poll wakeups.
    Introducing scheduling: transcript-poll-policy.ts:139. The watch-path function still returns a file only for the existing provider.

    Concrete input: an accepted automatic root whose small transcript contains provenance but never supplies a model; no subsequent hooks or file changes. Target polls around seconds 1, 3, 7, 15, 31, 63, 127, 255, 511, and 1,023, then expires the 30-minute lease. Base has zero model-poll wakeups.

    Quiet-owner work over 30 minutes 100 panes 1,000 panes
    Poll dispatches 1,000 10,000
    Unchanged-file path stats after initial reads 900 9,000
    Expiry callbacks 100 1,000

    The scheduler shares one timer: process timer firings depend on deadline coalescing, approximately 11–1,100 and 11–11,000, respectively. Those correspond to 0.006–0.611/s and 0.006–6.111/s averaged over the lease, versus zero in base. After expiry, the added rate becomes zero. Renderer model-poll idle rate remains zero.

    A relay caps accepted panes at 256, so 1,000 remotely owned panes require multiple owning processes; they do not all multiply into one relay. The finite lease and backoff bound this work, but do not satisfy the perf-scan rule against new idle wakeups. Use change-driven acquisition while preserving late transcript discovery and recovery.

    Required guard: an unchanged unresolved owner produces no recurring probe wakeups; a later append still resolves the model.

Remaining path and resource accounting

Path Source-proven bound and disposition
Initial/backlog reads At most one forward MiB plus one tail MiB per poll. JSON decoding/parsing runs on the owning event-loop thread; filesystem operations are asynchronous. No elapsed-time or CPU claim.
Historical progress Forward offset advances. An unchanged backlog reads approximately H + 1 MiB total if exhausted before resolution/expiry. The tail preview follows appends instead of rereading its initial MiB.
Independent history scaling For 100/1,000 panes, 10 MiB histories imply about 1.07/10.74 GiB cumulative reads; 100 MiB histories imply about 9.86/98.63 GiB. These are acquisition-work counts, conditional on scanning through the backlog—not measured throughput.
Cursor state Two carries/root, each logically capped at 256 KiB: 50/500 MiB logical carry limits at 100/1,000 roots. Decoded strings, parsed records, and backing allocations are outside the read-buffer reservation; no heap measurement was performed.
Read admission Per process: three native operations, 4,096 queued callers, 16 MiB reserved buffers globally, 4 MiB/batch, 20-second caller deadline.
Stalled operations Cancellation unlinks queued callers immediately. Native operations retain capacity and buffer reservations through actual settlement/close. Once all slots are stalled, new admission is refused; native settlement resumes FIFO progress.
Scheduler Addressed heap deadlines; no repeated full deadline-map scan. Owner/fence replacement aborts the former entry.
Publication Equal models publish nothing. A successful resolution publishes one pane row and stops that fence’s poll. Main avoids enriched, freshness, and row-mutation fanout. Finding 2 covers remaining renderer fanout.
Persistence Dirty-row SQLite patches; existing three-minute throttle. Model updates do not change authority fingerprints or introduce whole-inventory flushes.
Relay redelivery Existing 64-pane pending cap, 250 ms retry cadence, 40 timer attempts, then capacity-driven final attempt. Metadata merges preserve pending hook debt and owner checks.
Startup/replay Poll activation waits for listening. Main replay retains pane coordinates instead of tool bodies; relay activation uses accepted cached owners. Expired evidence does not renew the lease. Finding 1 also affects replay normalization.

Ownership and lifecycle review

Root/child/unknown classification, explicit-model suppression, automatic-model turn fences, numeric/string step indices, timestamp fallback, truncation/replacement, hook disable/re-enable, spool replay, terminal completion, owner retirement/replacement, and late native completion were traced. Remote envelopes apply model metadata only to the matching accepted owner. Desktop does not reread remote transcripts.

Cold-start work adds no subprocesses or heavyweight SDK imports. Foreground exposure consists of the synchronous path in finding 1, event-loop JSON parsing, and renderer work in finding 2. Windows, macOS, Linux, WSL, and SSH ownership paths were inspected in source; none was exercised.

Listener census

The metadata path bypasses enriched listeners for plugins, statistics, identity capture, title/resume recording, synthetic titles, and first-work actions. It also bypasses row/freshness listeners for worktree rows, transitions, workspace activity, mobile-session republishing, and awake holds.

The desktop bridge still publishes to the main renderer and dashboard popout. Renderer inspection covered IPC admission, accepted-status transactions, keyed projections, mobile status publication, attention, Activity, tab activity/identity, pets, palette/send targets, sleep/storage summaries, orchestration, dashboard, and session-history lookups. Plugin inventory is not invoked by the dedicated model-only path; normal hook events retain their existing inventory behavior.

Six questions and recurring classes

Scan question Disposition
Work before skip gates Finding 1
Ownership multiplication/recreation Shared reads/scheduling bounded; finding 2 for downstream inventories
Paying thread/storage Main/relay synchronous I/O in finding 1; renderer work in finding 2; asynchronous reads and dirty-row persistence traced
Growth/progress History cursors advance; queue/frontier/carry bounds checked
Execution host Host-local acquisition and remote ownership guards checked; runtime host validation unexecuted
Obsolete work/idle Queued teardown and late-close accounting checked; finding 3 for quiet-owner wakeups

Touched recurring classes: broad-map selection and collection derivation finding 2; newly reachable gated work and synchronous main filesystem work finding 1; quiet/hidden polling and new idle wakeups finding 3. No-op publication, unchanged-input reads, prefix rescans, queue fanout, entity retention, whole-file persistence, and eager imports were reviewed with the bounds above.

Pre-existing concerns remain separately identified: provenance reads with an already valid conversation ID are synchronous, and the plugin forwarder’s normal-hook pending queue can grow behind a stalled terminal inventory. The dedicated model path does not add plugin queue entries.

All changed test assertions were inspected only. They cover useful ownership, history, queue, replay, and selected publication contracts, but establish no execution result or runtime timing/CPU/heap evidence here.

Benchmark: head=458a6bfca7c4a446d42bb715860b9de1fec59d5b gate=FAIL —81 selected cases/13 files passed; the remaining full-listener and provenance workloads are not validated as passing. No runtime CPU/timing/heap claim.

@brennanb2025 brennanb2025 changed the title Show the model selected automatically by Antigravity Keep Antigravity model labels current Nov 21, 2026

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.

1 participant