Skip to content

fix(parser): preserve Antigravity CLI effort metadata - #1461

Merged
mariusvniekerk merged 4 commits into
kenn-io:mainfrom
jchuder:fix/antigravity-cli-effort
Aug 20, 2026
Merged

mariusvniekerk merged 4 commits into
kenn-io:mainfrom
jchuder:fix/antigravity-cli-effort

Conversation

@jchuder

@jchuder jchuder commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Antigravity CLI 1.1.5 stores generation data in a new format.

gen_metadata.idx identifies a generation. It does not identify a step.

Protobuf field 2 contains the step indices for the generation.

Generation field 19 contains the base model slug:

gemini-3.7-flash

The related executor_metadata field 28 contains the model effort:

gemini-3.7-flash-high

AgentsView currently uses gen_metadata.idx as the step index. This behavior can attach data to the wrong step.

It can also discard usage data when the two indices differ.

AgentsView does not read the model effort from the executor metadata.

As a result, the parsed model can lose its Low, Medium, or High effort.

Closes #1460.

Change

  • Read the packed step indices from generation field 2.
  • Map each generation to its first decoded planner step.
  • Use protobuf field 1 as the primary step kind.
  • Use the SQLite step_type value only when field 1 is absent.
  • Use the largest generation step index to select the executor range.
  • Select the first executor whose endStep includes that index.
  • Read the effort-qualified model from executor field 28.
  • Apply the executor model only when both base model slugs match.
  • Keep the complete field 21 display label when it is available.
  • Use gen_metadata.idx only when generation field 2 is absent.
  • Do not guess a step when field 2 is present but invalid.
  • Document the observed Antigravity CLI 1.1.5 fields.

Compatibility

The change keeps support for older session formats.

Sessions without executor_metadata continue to parse.

Sessions without generation field 2 continue to use the index-aligned format.

A complete field 21 label remains authoritative:

Gemini 3.7 Flash (High)

AgentsView does not apply an executor model when the base model slugs differ.

Verification

The regression tests cover these conditions:

  • The generation index differs from the planner step index.
  • Generation field 2 contains packed step indices.
  • The SQLite step_type value differs from protobuf field 1.
  • Protobuf field 1 identifies the step as a planner response.
  • Executor field 28 restores the -high suffix.
  • A different executor base model does not replace the generation model.
  • A complete field 21 label remains unchanged.
  • The usage event uses the planner timestamp.
  • The message receives the correct token counts.
  • An absent field 2 enables the legacy fallback.
  • A valid field 2 enables the new mapping.
  • An invalid field 2 does not enable the legacy fallback.
  • Older index-aligned sessions work without an executor table.

These commands completed successfully:

go test -tags fts5 ./internal/parser -count=1
make test-short

The Markdown source checks also passed.

The complete documentation check could not load origin/docs-assets. The fork does not contain that artifact branch.

Two independent reviewers found no remaining issues after the final fixes.

Data safety

The parser only reads the existing SQLite metadata.

This change does not modify a session database.

This change does not connect to the central PostgreSQL database.

This change does not run agentsview pg push.

This change does not start a resync.

This change does not change the remote backup.

@roborev-ci

roborev-ci Bot commented Aug 19, 2026

Copy link
Copy Markdown

roborev: Combined Review (3a2d8bd)

Parser changes need a medium-severity fix before approval.

Medium

  • internal/parser/antigravity.go:545 — Planner matching uses the SQL step_type, while decoding treats protobuf field 1 as authoritative. Rows with a default or stale SQL type can lose token/model attribution and event timestamps. Store and compare the resolved protobuf step kind, and test a SQL type 0 row whose payload field 1 is 15.

Reviewers: 2 done | Synthesis: codex, 5s | Total: 3m50s

@jchuder
jchuder force-pushed the fix/antigravity-cli-effort branch from 3a2d8bd to 18d7b74 Compare August 19, 2026 09:40
@jchuder jchuder changed the title fix(parser): recover Antigravity CLI effort metadata fix(parser): preserve Antigravity CLI effort metadata Aug 19, 2026
@roborev-ci

roborev-ci Bot commented Aug 19, 2026

Copy link
Copy Markdown

roborev: Combined Review (18d7b74)

No issues found.


Reviewers: 2 done | Synthesis: codex | Total: 3m43s

@jchuder
jchuder force-pushed the fix/antigravity-cli-effort branch from 18d7b74 to 077080b Compare August 19, 2026 18:15
@roborev-ci

roborev-ci Bot commented Aug 19, 2026

Copy link
Copy Markdown

roborev: Combined Review (83e0275)

No issues found.


Reviewers: 2 done | Synthesis: codex | Total: 2m10s

@mariusvniekerk mariusvniekerk self-assigned this Aug 20, 2026
Antigravity embeds compiled protobuf descriptors that name the SQLite
metadata fields. The parser previously treated those fields as anonymous
numbers and recursively accepted the first matching nested tags.

Follow the descriptor-backed chat model and executor paths for current
records. Keep the bounded legacy walk for older persisted records that do
not contain chat_model, and record the release evidence used to verify the
schema.
@roborev-ci

roborev-ci Bot commented Aug 20, 2026

Copy link
Copy Markdown

roborev: Combined Review (074eb20)

One medium-severity parser compatibility issue needs correction.

Medium

  • internal/parser/antigravity.go:515 — Every top-level field 2 is treated as packed step_indices, but legacy metadata uses field 2 as a nested protobuf wrapper. Those bytes can decode as plausible indices, bypassing the legacy gen_metadata.idx fallback and incorrectly associating usage/model data—or losing it entirely—while also dropping the correct event timestamp.

    Suggested fix: Decode field 2 as step_indices only after positively identifying the current CortexStepGeneratorMetadata schema. Otherwise, leave it absent and use legacy row-index mapping. Add an integration test covering a legacy field-2 token wrapper.


Reviewers: 2 done | Synthesis: codex, 11s | Total: 4m6s

Keep main's rewritten Grok format evidence while preserving the branch's
Antigravity descriptor provenance. This removes the pull request conflict
without restoring the Markdown formatter instability fixed on main.
@roborev-ci

roborev-ci Bot commented Aug 20, 2026

Copy link
Copy Markdown

roborev: Combined Review (f2b8415)

Code review found one medium-severity correctness issue.

Medium

  • internal/parser/antigravity.go:496 — Executor rows are discarded when their model path is absent or undecodable. Since the remaining rows define contiguous last_step_idx ranges, dropping a middle boundary can incorrectly associate generations in that range with a later executor model and effort.

    Fix: Preserve every valid last_step_idx boundary independently of model decoding, using an empty model for unknown entries. Add a test covering multiple ranges with an undecodable middle model.


Reviewers: 2 done | Synthesis: codex, 9s | Total: 4m36s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Antigravity CLI 1.1.5 parser loses model effort and generation usage

2 participants