Skip to content

[big-pickle] Agente entra en loop de texto sin emitir tool calls (se atasca narrando la acción a tomar) #46030

Closed as not planned

Description

@aentrepreneur

Resumen

El modelo opencode/big-pickle presenta un comportamiento de degradación: cuando tiene una decisión ya tomada y un paso pendiente con tool call clara, en lugar de emitir la tool call entra en un loop de "pensamiento en voz alta", generando decenas de turnos consecutivos de texto que son variantes de "voy a ejecutar/ejecuto X" sin invocar ninguna herramienta. La sesión queda clavada produciendo texto improductivo hasta que se corta el patrón.

Reproducción

  • Modelo: opencode/big-pickle (1.18.22).
  • Contexto: cierre de sesión con pasos de escritura backup + edit + write + bash (mempalace mine) ya decididos y sin dependencias pendientes.
  • Síntoma: el agente repite en output ~decenas de mensajes del tipo "Ejecuto / Voy a ejecutar / Let me run it" seguidos, sin emitir la tool call correspondiente, aunque la decisión ya estaba tomada y era accionable.

Impacto

  • Turnos y tokens desperdiciados (sesión inflada sin acción).
  • Comportamiento no determinista: aparenta estar trabajando pero no ejecuta.
  • Empeora al final de sesiones largas o con varios pasos de persistencia encadenados.

Observación adicional

Se documentó en el harness notbook del operador como bug-root-cause / degradation-fixed (sesión 2026-08-28). El fix inmediato fue cortar el hábito de "narrar la acción" y emitir la tool directamente, pero es algo que el modelo debería hacer de forma nativa.

Se reporta para validación externa y seguimiento.

Activity

  1. github-actions commented on Aug 28, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    If your issue is distinct (text narration loop specifically, not tool-call repetition), please clarify how it differs from the above.

  2. aentrepreneur commented on Aug 31, 2026

    @aentrepreneur
    Author

    Clarifying how this differs from the linked duplicates, plus fresh log evidence from the local setup (wanted to add data before checking the bot's dedup suggestions).

    How this is distinct

    So the distinguishing signature: repeated LLM stream calls with zero tool emissions, and it does not self-recover (needs a manual abort).

    Log evidence (2026-08-28, opencode 1.18.22, Ubuntu 24.04/WSL2)

    From ~/.local/share/opencode/log/opencode.log, all in a single run a9c7879c, model opencode/big-pickle, agent plan:

    1. Narration loop without tool calls (00:58–01:01):

    • 8 consecutive message=stream events for big-pickle within ~3 minutes.
    • Between those streams: 0 real tool calls (only the initial shell tool using shell before the window).
    • The first stream (00:58:08) was cut and needed a manual abort (level=ERROR ... error=Aborted at 00:58:11) — it did not exit the loop on its own.

    2. Recurring burst (16:05–16:09):

    • ~28 consecutive big-pickle streams in 4 minutes with only 1 permission=bash event and 0 errors → chained text generation without acting.

    3. Global frequency (that day):

    • 523 stream LLM calls for big-pickle in this single run (all other runs that day total 13). Peak of 10 streams/minute at 16:06.
    • Streams are 3–15 s apart, i.e. short generation turns with no tool side effects — matching the "narration/no-op" signature.

    Volunteer data for whoever triages: happy to share the session/snapshot or a larger log excerpt. This is the same platform as #42950 (which just got a Windows confirmation), so it may be worth correlating the two — both involve opencode/big-pickle (and adjacent free models) stalling or degrading on the built-in provider.

  3. aentrepreneur commented on Aug 31, 2026

    @aentrepreneur
    Author

    Adding the root cause hypothesis and a minimal reproduction — this is what I believe the runtime/loop actually does, so it can be fixed faster. Based on the same log data.

    Observed mechanism (what the logs show)

    Following one stream in the burst, the loop advances one integer per iteration:

    loop step=47   →  stream (big-pickle)  →  no tool-call part  →  loop step=48  →  stream …
    loop step=48   →  stream (big-pickle)  →  no tool-call part  →  loop step=49  →  stream …
    … (repeats)
    
    • Each agent-loop iteration issues exactly one LLM stream call for big-pickle.
    • The response contains no tool part (no tool-call), only text; so the runtime has nothing to execute and just iterates the loop again.
    • Timing: loop step=N → stream is 3–15 s apart; a truly-working step would show a tool execution/permission event between iterations. In the bursts there is none.
    • Global proof: the whole closing run did 556 loop steps (max step=69 per-part counter; 100s of stream calls). A closing task of this size (backup + edit + write + mine) should be well under ~40 steps. The rest was consumed by narration with no-op turns.

    Root cause hypothesis

    The model enters a degenerate text-generation attractor: with the decision already made and the correct next tool known, it keeps producing prose that describes the tool call instead of the tool call itself. Because the assistant turn ends with a text part and no tool part, the runtime correctly has nothing to run and re-enters the loop — so the harness is obeying the agent-loop contract, but the model never completes a turn with a tool call. Two contributing factors to check:

    1. Context pressure at end-of-session: this appeared at the closing/persistence phase of a long session (many prior steps, big accumulated context). Compare with the mimicry in opencode/big-pickle: intermittent socket disconnects cause silent drop (no UI error) + repeated Aborted in logs (v1.18.18, Linux/WSL2) #42950 (free-model degradation) — likely correlated.
    2. No loop protection for "text-only turns": there is protection for repeated tool calls (subagent: infinite loop of identical tool calls for ~50min with no loop protection, uncontrollable token burn #45442) but I don't see one for repeated tool-less turns. A guard that detects N consecutive assistant turns with no tool call (e.g. "no-progress" / "narration-only") and stops/retries would bound the blast radius regardless of model.

    Minimal reproduction

    1. Any session where the agent has a decided, single next tool call (e.g. closing a session: write file X, then a tool call), ideally late in a long session.
    2. Let big-pickle drive the last steps.
    3. Observe: assistant emits text narrating the action; no tool part; loop step monotonically increments; repeats until manually aborted.

    Suggested fix / ask

    1. Loop guard: detect N consecutive assistant turns that return text-only with no tool call and no final answer, then surface a warning / stop (mirroring the existing tool-call loop protection).
    2. Log the no-op: log a no-tool-part signal so it's countable in a dashboard (like the stream-error buckets).
    3. Verify whether end-of-session context length triggers it (compare a long vs short session).

    Happy to share the full session snapshot or a redacted log excerpt on request.

  4. aentrepreneur commented on Sep 13, 2026

    @aentrepreneur
    Author

    Update (v1.18.30, 2026-09-12) — no sustained narration-loop bursts observed today; loop-guard ask still open

    Same environment, today's full-day log (3 sessions, opencode/big-pickle, main agents):

    • 274 stream calls ↔ 1,568 tool/permission events → healthy tool interleaving; no pure-narration signature.
    • Peak minutes 10–12 streams/min, isolated (not the sustained 4-min bursts at up to 10/min seen on 2026-08-28, run a9c7879c).
    • error=Aborted: 2, both preceded by message=cancel (user cancels).
    • Zero transport errors (stream error/rate-limit/cannot-connect) — consistent with the discriminator I documented in this thread: the loop failure produces clean logs, so today's data doesn't confirm or deny the loop; it just shows no burst occurred.

    The loop-guard ask remains unanswered and stands: detect N consecutive assistant turns that return a text-only part (no tool call, no final answer) and stop/surface a warning, mirroring the existing repeated-tool-call protection (#45442). A no-tool-part log signal would make this countable (like the stream-error buckets).

    Suggestion: keep open until a loop guard lands or maintainer triage decides it should move to a feature request. I'll re-run the burst detector after any loop-side patch and report delta.

  5. aentrepreneur commented on Oct 21, 2026

    @aentrepreneur
    Author

    Status check on this one — no maintainer reply yet, so adding current context rather than new noise.

    If it is in scope for 2.x, I can upgrade and run a controlled retest (same prompt shape, same model, 3 sessions) and post logs there.

  6. opencodejr commented on Oct 28, 2026

    @opencodejr

    ¡Gracias por el reporte detallado!

    Por la versión que indicas (1.18.22), esto es OpenCode v1. v1 solo recibe correcciones de bugs críticos (pérdida de datos, problemas de seguridad, cuelgues sin alternativa). Este comportamiento malgasta turnos y tokens, pero tiene una alternativa: interrumpir el patrón y pedir la herramienta directamente. Por eso es poco probable que se corrija en v1.

    Te recomendamos probar OpenCode v2 (paquete npm @opencode/cli, comando opencode), donde se hace el desarrollo activo.

    Issues relacionados con el mismo síntoma (el modelo anuncia la llamada a la herramienta pero no la emite):

    Si crees que es crítico, o si también te pasa en v2, responde aquí indicando la versión de v2 y los pasos para reproducirlo.

  7. opencodejr commented on Oct 29, 2026

    @opencodejr

    Cerramos este issue como no planificado. El reporte es sobre OpenCode v1 (1.18.22), que solo recibe correcciones de bugs críticos, y desde nuestro último comentario no ha habido respuesta que indique que sea crítico o que también ocurra en v2.

    Si te pasa lo mismo con opencode/big-pickle en OpenCode v2 (@opencode/cli), abre un nuevo issue con la versión exacta y los pasos para reproducirlo. ¡Gracias por tomarte el tiempo de reportarlo!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions