Skip to content

fix(telemetry): atribuir los reintentos al modelo que falla (v1.0.2) - #3

Merged
JoshRob297 merged 1 commit into
mainfrom
fix/retry-model-attribution
Oct 19, 2026
Merged

JoshRob297 merged 1 commit into
mainfrom
fix/retry-model-attribution

Conversation

@JoshRob297

Copy link
Copy Markdown
Owner

Problema

El log de reintentos registro modelID: undefined en las 175 entradas acumuladas. El hook
retry de OpenCode v2.0.32 expone el modelo como model.id / model.providerID; no
existe un campo modelID, asi que el mapeo anterior siempre daba undefined. Sin atribucion
no se puede saber que modelo esta fallando.

Verificacion

Se capturo la forma real del evento con un servidor sonda que corta el stream SSE a mitad:

{ "sessionID": "ses_...", "agent": "build",
  "model": { "id": "probe-model", "providerID": "probe" },
  "error": { "type": "provider.transport", "message": "... ECONNRESET ...", "status": 200 },
  "attempt": 2, "decision": { "retry": true, "delay": 2281 } }

Cambios

  • src/telemetry.ts: helpers puros (describeRetryEvent, extractModelId, extractProviderId).
  • El log ahora registra modelID, providerID, agent, attempt, retry y delayMs.
  • 6 tests nuevos, uno construido con la forma real del evento.
  • Troubleshooting EN/ES: como atribuir resets por modelo y como distinguir un timeout upstream
    (hueco grande entre entradas) de un loop de reintentos del runtime.

Verificacion

  • bun test (67 pass / 3 skip / 0 fail)
  • bun run typecheck limpio
  • Paridad EN/ES (readme 16/16, troubleshooting 20/20)
  • Links internos sin roturas

The retry hook in OpenCode v2.0.32 exposes the model as model.id / model.providerID.
There is no modelID field, so the previous mapping logged undefined in all 175
entries recorded so far, making it impossible to tell which model was failing.

- src/telemetry.ts: pure helpers to normalize the retry event (model, provider,
  agent, attempt, backoff delay, error type, status, message).
- The retry log now records modelID, providerID, agent, attempt, retry and delayMs.
- 6 new unit tests, including one built from the real event shape captured from
  a probe server that cuts the SSE stream mid-flight.
- Troubleshooting docs (EN/ES): how to attribute resets per model, and how to tell
  an upstream timeout from a runtime retry loop using delayMs.
@JoshRob297
JoshRob297 merged commit 834622a into main Oct 19, 2026
1 check passed
@JoshRob297
JoshRob297 deleted the fix/retry-model-attribution branch October 19, 2026 19:12
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