Skip to content

(CODUX-220) Reuse execution rows for provider telemetry - #3030

Merged
numnx merged 2 commits into
feature/CODUX-220-reduce-invocation-visibility-latency-safelyfrom
task/feature-codux-22-t02-codex-d591266c-mrjjhe7r
Jul 13, 2026
Merged

(CODUX-220) Reuse execution rows for provider telemetry#3030
numnx merged 2 commits into
feature/CODUX-220-reduce-invocation-visibility-latency-safelyfrom
task/feature-codux-22-t02-codex-d591266c-mrjjhe7r

Conversation

@numnx

@numnx numnx commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

🧩 Task: Reuse execution rows for provider telemetry

Automated task PR opened by Code UX for T02.

📋 Summary

Sprint: Sprint 220 · Reduce invocation visibility latency safely · Task: T02

Make CLI task-coding execution invocations server-visible immediately after cancellation registration and before workspace preparation, while preserving truthful provider telemetry, recovery semantics, server-authoritative dashboards, and realtime Stats freshness.

🤖 Model & Provider

Provider Codex CLI
Model gpt-5.6-sol

⏱️ Timing

Started 2026-07-13 18:27:19 UTC
Finished 2026-07-13 18:27:51 UTC
Duration 32s

📊 Token Usage

Metric Value
Input tokens 271,449
Cached input tokens 9,780,224
Output tokens 24,761
Total tokens 10,076,434
Invocations 3
Tool calls 87
Active time 13m 51s

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

✅ 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
Make CLI provider execution reuse the pre-created execution invocation while creating provider usage only when the provider slot is claimed.

## Scope
- `src/services/cli-workflow/pipeline/execute-provider-stage.ts`, especially `executeProviderStage`
- `src/services/provider-execution-service.ts`, especially `ExecutionProviderRunArgs`, `executeProvider`, `runProviderInner`, and terminal updates
- `src/services/provider-concurrency-service.ts`, especially `waitForSlotAndClaim`
- `tests/backend/services/cli-workflow/pipeline/pipeline-stages.test.ts`
- `tests/backend/services/provider-execution-service.test.ts`
- `tests/backend/services/provider-concurrency-service.test.ts`

## Implementation Requirements
1. Pass `PipelineContext`'s execution invocation id to `ProviderExecutionService.executeProvider` and keep the execution row open through Git and PR finalization by using the existing finalization control rather than creating a second row.
2. When an invocation id is supplied, append or refresh the existing transcript, link the single provider usage row after the provider slot is claimed, and guard against claiming or updating provider work after the execution row has been cancelled.
3. Ensure CLI provider usage does not receive a timestamp captured before concurrency waiting; provider `started_at`, duration, and accounting must begin at the actual claim/run phase while preserving explicit timestamp behavior for other callers such as Jules.
4. Add tests for reuse, one-to-one execution/provider linkage, no provider usage during preparation, cancellation before claim, and provider duration excluding preparation and slot-wait time.

## Constraints
- Never create fake provider usage or token telemetry during workspace preparation.
- Preserve existing provider retry, shutdown recovery, redaction, and terminal-status protections.
- Do not change provider concurrency limits or introduce a new client/server protocol.
- Keep documentation changes in the dedicated documentation task.

## Verification
- Run `pnpm exec vitest run tests/backend/services/cli-workflow/pipeline/pipeline-stages.test.ts tests/backend/services/provider-execution-service.test.ts tests/backend/services/provider-concurrency-service.test.ts`.
- Assert that a supplied invocation id prevents fallback execution-row creation and that exactly one linked provider usage row exists after a real provider claim.
- Run `pnpm run lint`.
🌿 Branch Info

Base: feature/CODUX-220-reduce-invocation-visibility-latency-safely
Head: task/feature-codux-22-t02-codex-d591266c-mrjjhe7r


🤖 Generated by Code UX

@numnx
numnx merged commit 9939bba into feature/CODUX-220-reduce-invocation-visibility-latency-safely Jul 13, 2026
20 checks passed
@numnx
numnx deleted the task/feature-codux-22-t02-codex-d591266c-mrjjhe7r branch July 13, 2026 18:40
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