fix(config): add "Not logged in" to default Claude error patterns#269
Conversation
When Claude Code outputs "Not logged in" inside a Docker container, ralphex did not recognize it as a fatal error and kept retrying indefinitely. This caused hung containers that eventually crashed the Docker Desktop VM.
… to SIGTERM On Ctrl+C and SIGTERM, the wrapper sent SIGTERM to the docker process and waited indefinitely. When Docker Desktop VM is in a bad state, the process never terminates and the wrapper hangs. Now escalates to SIGKILL after 5 seconds.
There was a problem hiding this comment.
Pull request overview
Updates default Claude error-pattern handling and Docker wrapper shutdown behavior so ralphex can fail fast on authentication errors and terminate more reliably when interrupted.
Changes:
- Add
"Not logged in"to defaultclaude_error_patterns(and associated tests) to stop retry loops when Claude is unauthenticated. - Add test coverage for matching and surfacing the new pattern.
- In the Docker wrapper, escalate from SIGTERM to SIGKILL when the
docker runprocess does not exit promptly on interrupts/termination.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
scripts/ralphex-dk.sh |
Adds timeout-based termination escalation (SIGTERM → SIGKILL) for the docker subprocess on Ctrl+C/SIGTERM. |
pkg/executor/executor_test.go |
Adds unit tests ensuring "Not logged in" is detected via pattern matching and surfaced as an error. |
pkg/config/values_test.go |
Updates embedded-defaults test to include the new default Claude error pattern. |
pkg/config/defaults/config |
Extends default claude_error_patterns list to include "Not logged in". |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
umputun
left a comment
There was a problem hiding this comment.
LGTM, thx. both fixes make sense for Docker reliability.
one minor nit - _terminate_proc() doesn't call proc.wait() after proc.kill(), while _term_handler() does. not a bug since the caller reaps the zombie, but the inconsistency is a bit confusing. up to you whether to align them.
btw I'll update the docs (CLAUDE.md, README.md) with the new default pattern on my side, no need to bother with it here.
Summary
claude_error_patternsso ralphex exits gracefully instead of retrying indefinitely when Claude outputs this message inside Docker containers.