Skip to content

Use Gemini CLI Exit Codes for Robust Error Handling #217

@jerop

Description

@jerop

Problem

Currently, GitHub Action has to rely on fragile string matching to detect specific error conditions from Gemini CLI output (see #205, #206). This approach is brittle and breaks when error messages change - #206 (comment).

Solution

Use exit codes once they're available in Gemini CLI - google-gemini/gemini-cli#6745.

Example usage of error codes:

Exit Code Error Type Action Annotation Retry? Cleanup Action
0 Success None No Continue workflow
2 Auth Failure ::error No Post auth help comment
3 Rate Limit ::warning Yes (3x) Wait with backoff
4 Session Limit ::error No Post session limit comment
5 Network Issues ::warning Yes (2x) Retry with delay
6 Config Error ::error No Post config help comment
7 Permission Denied ::error No Post permission help comment
Other General Failure ::error No Post generic error comment

Metadata

Metadata

Labels

area/corekind/enhancementNew feature or requestpriority/p0Critical and urgent e.g., critical security vulnerability, major breakage

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions