Skip to content

gut(cron): replace vestigial model/provider telemetry with runtime field#2121

Merged
alexey-pelykh merged 1 commit intomainfrom
gut/cron-runtime-telemetry
Apr 8, 2026
Merged

gut(cron): replace vestigial model/provider telemetry with runtime field#2121
alexey-pelykh merged 1 commit intomainfrom
gut/cron-runtime-telemetry

Conversation

@alexey-pelykh
Copy link
Copy Markdown

Summary

  • Replace model and provider fields in CronRunTelemetry with a single runtime field capturing the resolved agent runtime (claude/gemini/codex/opencode) from resolveAgentRuntimeOrThrow()
  • Remove fallbackModel/fallbackProvider variables from run.ts — these only fed telemetry and always resolved to "unknown"
  • Update full telemetry pipeline: types, schema, producer, propagation, consumer (run-log parser, UI, usage report script)
  • Existing JSONL entries with old model/provider fields are silently ignored on parse (backward compat via type narrowing)

Closes #2110

Test plan

  • pnpm tsgo passes (no new type errors)
  • pnpm format passes
  • pnpm lint passes
  • All 38 cron test files pass (266 tests passed)
  • CI build + test jobs pass

🤖 Generated with Claude Code

…eld (#2110)

Replace `model` and `provider` fields in `CronRunTelemetry` with a single
`runtime` field that captures the resolved agent runtime (claude/gemini/
codex/opencode) from `resolveAgentRuntimeOrThrow()`.

The old fields always resolved to "unknown" because RemoteClaw's CLI
runtimes own model selection — the middleware has no visibility into
which model the CLI chose. The resolved runtime IS available and is now
captured in telemetry.

Changes span the full telemetry pipeline:
- Type layer: CronRunTelemetry, CronRunLogEntrySchema, UI CronRunLogEntry
- Producer: run.ts captures resolvedRuntime, removes fallbackModel/Provider
- Propagation: timer.ts emitJobFinished, ops.ts, server-cron.ts
- Consumer: run-log.ts parser, cron UI view, usage report script

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@alexey-pelykh alexey-pelykh enabled auto-merge (squash) April 8, 2026 07:45
@alexey-pelykh alexey-pelykh merged commit 3e8e47a into main Apr 8, 2026
9 checks passed
@alexey-pelykh alexey-pelykh deleted the gut/cron-runtime-telemetry branch April 8, 2026 07:56
alexey-pelykh added a commit that referenced this pull request Apr 8, 2026
The upstream #2121 re-enabled these tests which now need the
resolveAgentRuntime mock and updated default assertions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
alexey-pelykh added a commit that referenced this pull request Apr 8, 2026
…e name (#2124)

* fix(session): resolve CLI session key mismatch — use runtime name as provider (#2105)

The gutted resolveDefaultModel() stub returned defaultProvider: "unknown",
which flowed through to providerUsed. Since isCliProvider("unknown") returned
false, CLI session IDs were never persisted — preventing --resume from being
passed on subsequent messages in the same thread.

Three changes fix the pipeline:

1. resolveDefaultModel() now uses resolveAgentRuntime() to return the actual
   runtime name (e.g. "claude") as the default provider.

2. isCliProvider() recognizes the four agent runtime names (claude, gemini,
   codex, opencode) as CLI providers, independent of cliBackends config.

3. The cron isolated-agent path uses the same runtime-based provider
   resolution instead of hardcoded "unknown".

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(test): add resolveAgentRuntime mock to cron-model-override test

The upstream #2121 re-enabled these tests which now need the
resolveAgentRuntime mock and updated default assertions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

gut(cron): replace vestigial model/provider telemetry with runtime field

1 participant