Skip to content

fix(session): recognize Gemini CLI 'Invalid session identifier' as session-not-found#35

Merged
osolmaz merged 1 commit intoopenclaw:mainfrom
louria:fix/gemini-invalid-session-fallback
Mar 1, 2026
Merged

fix(session): recognize Gemini CLI 'Invalid session identifier' as session-not-found#35
osolmaz merged 1 commit intoopenclaw:mainfrom
louria:fix/gemini-invalid-session-fallback

Conversation

@louria
Copy link
Contributor

@louria louria commented Feb 28, 2026

Problem

When acpx reconnects a Gemini session, it sends session/load with acpx's
own session UUID. Gemini CLI does not know this UUID and returns:

Invalid session identifier "2f8f4712-..."

with JSON-RPC error code -32603. isSessionNotFoundText() did not match
this text, so shouldFallbackToNewSession() returned false and the error
was thrown instead of falling back to session/new.

This caused every acpx gemini prompt --session to fail with
[error] RUNTIME: Internal error, while acpx gemini exec worked fine.

Fix

Add "invalid session identifier" to the pattern list in
isSessionNotFoundText().

Test

acpx gemini sessions newecho "Say hello" | acpx --verbose gemini prompt --file -
Before: [error] RUNTIME: Internal error
After: [acpx] loadSession failed, started fresh session → prompt succeeds

…ssion-not-found

Gemini CLI returns 'Invalid session identifier' with JSON-RPC code -32603
when session/load is called with an acpx-owned UUID. This text was not
matched by isSessionNotFoundText, preventing the reconnect fallback to
session/new and causing RUNTIME: Internal error.

Add 'invalid session identifier' to the pattern list.
@osolmaz osolmaz merged commit b9b2c5a into openclaw:main Mar 1, 2026
1 check failed
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.

2 participants