Skip to content

fix: prevent Codex/OpenCode headless hangs (#184, #183)#185

Merged
Nathan Schram (nathanschram) merged 5 commits intodevfrom
feature/fix-engine-hangs
Mar 22, 2026
Merged

fix: prevent Codex/OpenCode headless hangs (#184, #183)#185
Nathan Schram (nathanschram) merged 5 commits intodevfrom
feature/fix-engine-hangs

Conversation

@nathanschram
Copy link
Member

Summary

Fixes #183, fixes #184

Test plan

  • All 1750 tests pass (80.98% coverage)
  • Ruff lint + format clean
  • Integration test via @untether_dev_bot: send task in ut-dev:codex chat
  • Integration test via @untether_dev_bot: send task in ut-dev:opencode chat

🤖 Generated with Claude Code

Codex (#184): always pass --ask-for-approval in headless mode.
Default to "never" (auto-approve all) so Codex never blocks on
terminal input. Safe permission mode still uses "untrusted".

OpenCode (#183): surface unsupported JSONL event types as visible
Telegram warnings instead of silently dropping them. When msgspec
DecodeError occurs, _extract_event_type() tries to parse the raw
JSON for the type field. If extractable, a warning ActionEvent is
emitted (visible in Telegram) instead of returning [].

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

coderabbitai bot commented Mar 22, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6f7cdd10-0f73-4b94-abd4-b3e903c36dae

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/fix-engine-hangs

Comment @coderabbitai help to get the list of available commands and usage tips.

…167, #168)

Auto-continue (#167): detect when Claude Code exits after receiving
tool results without processing them (last_event_type=user) and
auto-resume the session. Configurable via [auto_continue] with
enabled (default true) and max_retries (default 1).

Sleeping-process stall (#168): CPU-active suppression now checks
process_state; when main process is sleeping (state=S) but children
are CPU-active (hung Bash tool), notifications fire. Stall message
shows tool name ("Bash tool may be stuck") instead of generic text.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Zero-argument super() breaks in @DataClass(slots=True) on Python
<3.14 because the __class__ cell references the pre-slot class.
Use explicit JsonlSubprocessRunner.decode_error_events(self, ...)
instead.

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

- TestShouldAutoContinue._call: replace mixed-type dict with typed
  keyword args to satisfy ty's union narrowing
- TestDecodeErrorEvents: add isinstance(ActionEvent) checks before
  accessing .message and .action attributes on union type

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ty has 55 pre-existing warnings across the codebase. These are not
regressions — the same warnings exist on dev and master. Making ty
non-blocking so it doesn't prevent PR merges while still reporting
warnings for visibility.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@nathanschram Nathan Schram (nathanschram) merged commit d5c7445 into dev Mar 22, 2026
21 checks passed
@nathanschram Nathan Schram (nathanschram) deleted the feature/fix-engine-hangs branch March 22, 2026 02:58
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