Skip to content

fix(server): oh my pi turns stuck silently forever now auto-fail - #18

Merged
leonardoxr merged 2 commits into
main-xavierfrom
fix/omp-silence-watchdog-give-up
Aug 19, 2026
Merged

fix(server): oh my pi turns stuck silently forever now auto-fail#18
leonardoxr merged 2 commits into
main-xavierfrom
fix/omp-silence-watchdog-give-up

Conversation

@leonardoxr

@leonardoxr leonardoxr commented Aug 19, 2026

Copy link
Copy Markdown
Owner

Problem

Threads driven by the omp ACP provider would occasionally stop receiving anything from the model and get stuck showing Working forever, with no recovery — indistinguishable from the agent process dying in the background.

The adapter already had a provider-silence watchdog (75s of no tokens/tool-calls/pending-approvals → flag the session quiet), but it only ever posted a passive banner ("No output from the provider for Xs… you can stop the turn"). It never actually gave up on the turn. If nobody noticed and manually hit Stop, the thread just sat there indefinitely — matching omp's known internal failure mode of retrying an upstream 5xx forever without reporting it.

Confirmed via the live ~/.t3/userdata DB/logs that this mechanism (providerQuietSince / resolveOmpQuietTransition) exists only in the omp adapter — Cursor/Grok/Claude/Codex have no equivalent watchdog.

Fix

apps/server/src/provider/Layers/OmpAdapter.ts:

  • Added OMP_PROVIDER_SILENCE_GIVE_UP_THRESHOLD_MILLIS (10 minutes) and resolveOmpSilenceGiveUp, tracking total time since a session was first marked quiet.
  • The existing 15s watchdog tick now also checks this on every tick (not just mark/clear transitions).
  • Once total silence crosses 10 minutes with nothing legitimately outstanding (same eligibility gate as the existing mark logic: no streaming, no open tool call, no pending approval/input), it auto-interrupts the turn using the exact same machinery the manual Stop button already uses (session/cancel + local prompt-fiber cancel + settlePromptInFlight), settling the turn as failed with a clear message instead of leaving it hanging.

Also added a regression test for the provider process dying mid-prompt (T3_ACP_EXIT_DURING_PROMPT mock-agent knob) — a related, previously-untested path. It was already handled correctly and was not the source of this bug, but is now covered.

Scoped entirely to the omp adapter; no shared code with Cursor/Grok/Claude/Codex touched.

Testing

  • OmpAdapter.test.ts: 32/32 passing (new unit test for resolveOmpSilenceGiveUp's threshold boundary + new integration test for process death mid-prompt).
  • tsgo --noEmit on apps/server: clean, no new errors.

Model: Claude Sonnet 4.5, harness: Oh My Pi

The provider-silence watchdog for the omp ACP adapter only ever posted
a passive 'no output' banner after 75s of silence — it never actually
gave up. A thread nobody was watching stayed on "Working" indefinitely
whenever omp went quiet (its known internal retry-forever-on-5xx
failure mode), recoverable only by a user noticing and clicking Stop.

Adds a much larger give-up threshold (10 minutes of total silence with
nothing legitimately outstanding — no streaming, no tool call, no
pending approval/input) that reuses the same cancel + settle machinery
the manual Stop button already uses, so the turn now fails
automatically with a clear error instead of hanging forever.

Also adds a regression test for the child process dying mid-prompt
(a related but previously untested path, confirmed already working
correctly and not the source of this bug).

Scoped entirely to the omp adapter; Cursor/Grok/Claude/Codex have no
equivalent watchdog and are untouched.

Model: Claude Sonnet 4.5, harness: Oh My Pi
@github-actions github-actions Bot added size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Aug 19, 2026
…e-watchdog-give-up

# Conflicts:
#	apps/server/src/provider/Layers/OmpAdapter.ts
@leonardoxr
leonardoxr merged commit 9efb9dd into main-xavier Aug 19, 2026
5 checks passed
@leonardoxr
leonardoxr deleted the fix/omp-silence-watchdog-give-up branch August 19, 2026 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant