Repository navigation
fix(telemetry): atribuir los reintentos al modelo que falla (v1.0.2) - #3
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problema
El log de reintentos registro
modelID: undefineden las 175 entradas acumuladas. El hookretryde OpenCode v2.0.32 expone el modelo comomodel.id/model.providerID; noexiste un campo
modelID, asi que el mapeo anterior siempre daba undefined. Sin atribucionno 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).modelID,providerID,agent,attempt,retryydelayMs.(hueco grande entre entradas) de un loop de reintentos del runtime.
Verificacion
bun test(67 pass / 3 skip / 0 fail)bun run typechecklimpio