feat(agents): stream provider observations - #159
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThe PR adds normalized provider activity and token-usage observations across Codex, Claude, OpenCode, Pi, and ACP adapters.
Confidence Score: 5/5The PR appears safe to merge, with no concrete blocking or independently actionable non-blocking defect established. Provider observations flow through the existing workflow persistence path, usage fields are normalized and aggregated consistently with existing workflow views, and no reachable incorrect behavior remains supported by the available repository evidence.
|
| Filename | Overview |
|---|---|
| src/local-agent-provider-observations.ts | Adds provider-independent structural extraction and normalization for tool activity and token usage. |
| src/local-agent-adapters.ts | Connects Claude, OpenCode, ACP, and Pi provider payloads to observation emission and final usage reporting. |
| src/local-agent-runtime.ts | Adds observation deduplication and Codex activity and usage extraction. |
| src/cli-output.ts | Exposes per-call usage and field-wise aggregate workflow-run usage. |
| src/local-agent-provider-observations.test.ts | Covers representative activity and usage payloads for all supported provider families. |
Sequence Diagram
sequenceDiagram
participant Provider
participant Adapter
participant Extractor as Observation Extractor
participant Workflow as Workflow Runtime
participant Store
participant CLI
Provider->>Adapter: events and final response
Adapter->>Extractor: provider payloads
Extractor-->>Adapter: activity and usage observations
Adapter->>Workflow: observations and run result
Workflow->>Store: persist activity and latest usage
Store-->>CLI: call records
CLI->>CLI: sum final call usage
Reviews (1): Last reviewed commit: "feat(agents): wire provider observation ..." | Re-trigger Greptile
Agent providers expose different event and token-usage shapes, so workflow observability otherwise stops at the adapter boundary. Structural normalizers now cover Codex, Claude, OpenCode, Pi, and ACP-backed Cursor/Copilot events, while each adapter forwards best-effort tool activity and usage into the workflow journal and CLI output. Values are only emitted when the provider supplies them; unsupported or disabled providers do not produce fabricated observations. This is the top layer of the stack.