Skip to content

(CODUX-129) Harden OpenCode and Antigravity parsers - #2811

Merged
numnx merged 1 commit into
feature/sprint-COWIN-3-feat-invocation-parsing-all-providers-implementationfrom
task/feature-sprint-c-t04-codex-6b1c8201-mreirsd4
Jul 10, 2026
Merged

(CODUX-129) Harden OpenCode and Antigravity parsers#2811
numnx merged 1 commit into
feature/sprint-COWIN-3-feat-invocation-parsing-all-providers-implementationfrom
task/feature-sprint-c-t04-codex-6b1c8201-mreirsd4

Conversation

@numnx

@numnx numnx commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

🧩 Task: Harden OpenCode and Antigravity parsers

Automated task PR opened by Code UX for T04.

📋 Summary

Sprint: Sprint 3 · Feat: Invocation Parsing all Providers · Task: T04

Implement extended invocation parsing across every local CLI provider so provider-backed invocations persist normalized user, assistant, reasoning, tool-call, and tool-result turns with accurate usage metadata, regression coverage, and updated documentation.

🤖 Model & Provider

Provider Codex CLI
Model gpt-5.5

⏱️ Timing

Started 2026-07-10 05:53:06 UTC
Finished 2026-07-10 06:02:56 UTC
Duration 9m 49s

📊 Token Usage

Metric Value
Input tokens 99,196
Cached input tokens 2,080,512
Output tokens 19,359
Total tokens 2,199,067
Invocations 1
Tool calls 49
Active time 8m 2s

Included usage estimate (subscription/local login): $2.12

✅ QA Review

⏳ QA review runs after this PR is opened. Check the task card in the dashboard for the outcome once it lands.

📝 Full Task Prompt
## Objective
Improve OpenCode and Antigravity invocation parsing so their native streams and transcript stores produce normalized conversation turns and usage isolated to the current invocation.

## Scope
- Edit `src/infrastructure/providers/cli/provider-logs/opencode-log-parser.ts`
- Edit `src/infrastructure/providers/cli/provider-logs/antigravity-log-parser.ts`
- Edit `src/infrastructure/providers/cli/provider-transcripts.ts` only if transcript lookup patterns need to include additional known Antigravity paths
- Edit `tests/backend/infrastructure/providers/cli/opencode-log-parser.test.ts`
- Edit `tests/backend/infrastructure/providers/cli/antigravity-log-parser.test.ts`
- Verify integration behavior through `tests/backend/infrastructure/providers/cli/provider-usage.test.ts`
- Relevant symbols: `parseOpenCodeJsonLines`, `parseOpenCodeExport`, `subtractOpenCodeBaseline`, `parseAntigravityTranscript`, `parseAntigravityDatabase`, `parseAntigravityConversationId`

## Implementation Requirements
1. Extend OpenCode parsing for `session.created`, text, reasoning, tool, step-finish, assistant message, and current export payload shapes while keeping session id extraction stable.
2. Ensure OpenCode export usage remains authoritative when present and that `subtractOpenCodeBaseline` isolates follow-up runs from cumulative native session totals.
3. Extend Antigravity transcript parsing for transcript JSONL and overview-style entries that expose user, assistant, reasoning, tool call, and tool result content, while preserving database usage extraction from `gen_metadata` rows.
4. Add parser tests for OpenCode streaming turns, export payload extraction from noisy stdout, baseline subtraction, Antigravity transcript variants, conversation id detection, malformed rows, and `sinceIdx` database usage isolation.

## Constraints
- Do not treat OpenCode `run --format json` stdout token data as more authoritative than `opencode export` when export data is available.
- Do not re-report prior OpenCode or Antigravity cumulative session usage for resumed invocations.
- Do not throw on malformed transcript rows or missing local database files.
- Do not edit Codex, Gemini, Claude, or Qwen parser files in this task.

## Verification
- Run `pnpm exec vitest run tests/backend/infrastructure/providers/cli/opencode-log-parser.test.ts tests/backend/infrastructure/providers/cli/antigravity-log-parser.test.ts tests/backend/infrastructure/providers/cli/provider-usage.test.ts`.
- Run `pnpm run lint`.
- Success means OpenCode and Antigravity emit normalized turns when data exists, isolate cumulative usage for resumed sessions, and fall back cleanly when transcript or usage data is unavailable.
🌿 Branch Info

Base: feature/sprint-COWIN-3-feat-invocation-parsing-all-providers-implementation
Head: task/feature-sprint-c-t04-codex-6b1c8201-mreirsd4


🤖 Generated by Code UX

@numnx
numnx merged commit af604b1 into feature/sprint-COWIN-3-feat-invocation-parsing-all-providers-implementation Jul 10, 2026
@numnx
numnx deleted the task/feature-sprint-c-t04-codex-6b1c8201-mreirsd4 branch July 10, 2026 06:03
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