Skip to content

fix(config): add "Not logged in" to default Claude error patterns#269

Merged
umputun merged 3 commits intoumputun:masterfrom
nnemirovsky:fix/not-logged-in-error-pattern
Apr 8, 2026
Merged

fix(config): add "Not logged in" to default Claude error patterns#269
umputun merged 3 commits intoumputun:masterfrom
nnemirovsky:fix/not-logged-in-error-pattern

Conversation

@nnemirovsky
Copy link
Copy Markdown
Contributor

Summary

  • Add "Not logged in" to default claude_error_patterns so ralphex exits gracefully instead of retrying indefinitely when Claude outputs this message inside Docker containers.
  • Escalate to SIGKILL in the Docker wrapper when the docker process does not respond to SIGTERM within 5 seconds on Ctrl+C or SIGTERM.

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.
@nnemirovsky nnemirovsky requested a review from umputun as a code owner April 5, 2026 04:06
Copilot AI review requested due to automatic review settings April 5, 2026 04:06
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 default claude_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 run process 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.

Comment thread scripts/ralphex-dk.sh
Comment thread scripts/ralphex-dk.sh
Copy link
Copy Markdown
Owner

@umputun umputun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@umputun umputun merged commit 2711b0d into umputun:master Apr 8, 2026
2 checks passed
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.

3 participants