Skip to content

Make session error detection patterns configurable or documented #6

@ArjenSchwarz

Description

@ArjenSchwarz

Context

The isSessionInvalidError function in internal/orbit/orbit.go uses hardcoded string patterns to detect session-related errors:

sessionErrors := []string{
    "session not found",
    "invalid session",
    "session expired",
    "no such session",
}

If Claude CLI changes its error messages, detection could break silently.

Proposed Change

Options:

  1. Minimal: Extract patterns to a package-level variable with documentation
  2. Full: Make patterns configurable via .orbit.yaml

Minimal example:

// sessionErrorPatterns contains error message substrings that indicate
// a session-related error from Claude CLI. If Claude changes its error
// messages, these patterns may need updating.
var sessionErrorPatterns = []string{
    "session not found",
    "invalid session",
    "session expired",
    "no such session",
}

Affected Files

  • internal/orbit/orbit.go:492-498

Priority

Low - The current patterns work. This is a maintainability improvement.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions