Skip to content

feat(antigravity): extract initial user prompt and attribute userMessage - #1793

Open
dcaldr wants to merge 1 commit into
getagentseal:mainfrom
dcaldr:feat/antigravity-user-message
Open

dcaldr wants to merge 1 commit into
getagentseal:mainfrom
dcaldr:feat/antigravity-user-message

Conversation

@dcaldr

@dcaldr dcaldr commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #1792

Why this change is needed

In CodeBurn, userMessage is load-bearing beyond display:

  • Activity Classification: classifyConversation and refineByKeywords inspect turn.userMessage to categorize turns into Coding, Planning, and Exploration. Without prompt text, Antigravity turns without direct file edits collapsed into generic Conversation, misattributing ~60% of coding work.
  • Pull Request Links: extractPrUrlsFromText(call.userMessage) scans user prompts for PR URLs. Antigravity previously attributed 0 PR links from prompt text.
  • Session Identification: codeburn sessions and dashboards showed opaque fallback cascade IDs instead of task descriptions.

What this PR does

  • Extracts the initial human prompt from brain/<cascadeId>/.system_generated/logs/transcript.jsonl (unwrapping <USER_REQUEST> and bounding to 500 characters, matching CodeBurn's cross-provider convention).
  • Adds a defensive fallback to decode prompt text from steps (step_payload field 19.2) in SQLite when transcript logs are unavailable.
  • Bumps ANTIGRAVITY_CACHE_VERSION = 10 and PROVIDER_PARSE_VERSIONS.antigravity (-user-msg-v1) so cached sessions gain prompt attribution with byte-for-byte cost and token parity ($0.00 drift).

Follow-up to precursor Antigravity PRs #1456, #1620, and #1712, following the precedent established in #1581 (ZCode prompt attribution).

Testing / Verification

  • I have tested this locally against real data (not just unit tests)
  • npm test passes
  • npm run build succeeds
  • Not a UI change

Verification Proof

Unit test suite (npx vitest run tests/providers/antigravity.test.ts):

 ✓ tests/providers/antigravity.test.ts (67 tests) 1043ms
 Test Files  1 passed (1)
      Tests  67 passed (67)

Real data verification (codeburn today --provider antigravity):

Before (Baseline - no prompt text, Coding collapsed into Conversation):

╭──────────────────────────────────────────────────────────────────────────────╮
│ By Activity                                                                  │
│                                                            cost turns 1-shot │
│ ██████████ Conversation                                   $7.49   629      - │
│ █░░░░░░░░░ Planning                                      $0.379    34      - │
│ ░░░░░░░░░░ Exploration                                  $0.0079     1      - │
╰──────────────────────────────────────────────────────────────────────────────╯

After (With Patch - 209 coding turns and 15 exploration turns properly categorized):

╭──────────────────────────────────────────────────────────────────────────────╮
│ By Activity                                                                  │
│                                                            cost turns 1-shot │
│ ██████████ Conversation                                   $4.88   402      - │
│ █████░░░░░ Coding                                         $2.22   209      - │
│ █░░░░░░░░░ Planning                                      $0.379    34      - │
│ █░░░░░░░░░ Exploration                                   $0.351    16      - │
╰──────────────────────────────────────────────────────────────────────────────╯

Zero Drift Accounting:

  • Total spend: $7.88 (Before) vs. $7.88 (After) -> $0.00 drift.
  • Total calls: 664 (Before) vs. 664 (After) -> 0 call drift.
  • 227 turns shifted cleanly from generic conversation to verified coding and exploration.

Read initial user prompt from transcript.jsonl (or SQLite steps table fallback)
into ParsedProviderCall.userMessage, bound to 500 chars and cleaned of <USER_REQUEST>
tags. Bumps cache version to 10 and provider parse version with -user-msg-v1.

Closes getagentseal#1792
@dcaldr
dcaldr requested a review from iamtoruk as a code owner October 24, 2026 14:06
@ozymandiashh ozymandiashh added area: cli The codeburn CLI and its core parsing/reporting engine enhancement New feature or request provider: antigravity Antigravity provider labels Oct 24, 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

area: cli The codeburn CLI and its core parsing/reporting engine enhancement New feature or request provider: antigravity Antigravity provider

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(antigravity): extract initial user prompt for userMessage session attribution

2 participants