feat(workflow): mark workloads as failed if they hit session limit#206
feat(workflow): mark workloads as failed if they hit session limit#206leehagoodjames wants to merge 1 commit intogoogle-github-actions:mainfrom
Conversation
jerop
left a comment
There was a problem hiding this comment.
would we need such error handling for other fatal errors? is there a way to generalize this to other fatal errors?
| echo "${GEMINI_ERRORS}" >> "${GITHUB_OUTPUT}" | ||
| echo "EOF" >> "${GITHUB_OUTPUT}" | ||
|
|
||
| if echo "${GEMINI_ERRORS}" | grep -q "Reached max session turns for this session"; then |
There was a problem hiding this comment.
if the error message"Reached max session turns for this session" changes, then this stops working, right?
There was a problem hiding this comment.
Yes that is correct. I see two approaches:
- Hitting the
maxSessionTurnslimit causesgemini-clito exit with a specific error code
- Pros
- Very easy to parse downstream
- Cons
- Likely not appropriate for all gemini-cli invocations
- (Current behavior) Hitting the
maxSessionTurnslimit causesgemini-clito exit with a0.
- Pros
- Does not build into
gemini-clithe assumption that hitting themaxSessionTurnsindicates that the workload failed
- Does not build into
- Cons
- Difficult for clients to reliably determine if the
maxSessionTurnslimit was hit, as checking the output errors requires fragile string matching
- Difficult for clients to reliably determine if the
Does gemini-cli currently support any type of output that enumerates the possible reasons for ending ?
There was a problem hiding this comment.
I think it would be better for the gemini-cli to publish specific exit codes for these kinds of things, no?
There was a problem hiding this comment.
Agree, this should be an upstream change in Gemini CLI
There was a problem hiding this comment.
📋 Review Summary
This PR adds a check to explicitly fail the action when the session turn limit is reached. This is a good improvement to the action's error handling.
🔍 General Feedback
- The approach of checking the error message is a bit brittle, but given the current limitations, it's a reasonable solution.
- The code is clear and easy to understand.
- I've added one inline comment with a suggestion for improvement.
|
|
||
| if echo "${GEMINI_ERRORS}" | grep -q "Reached max session turns for this session"; then | ||
| FAILED=true | ||
| fi |
There was a problem hiding this comment.
Since we don't have that, we can at least make the grep more specific to avoid accidentally matching other error messages.
| fi | |
| if echo "${GEMINI_ERRORS}" | grep -q "Reached max session turns for this session"; then | |
| echo "::error title=Max session turns reached::The Gemini CLI session has reached its maximum number of turns and cannot continue." | |
| FAILED=true | |
| fi |
|
@gemini-cli /review how can we improve the prompt? |
|
🤖 Hi @jerop, I've received your request, and I'm working on it now! You can track my progress in the logs for more details. |
|
fyi above workflow failed because the PR is from a fork: #167 |
|
🤖 I'm sorry @jerop, but I was unable to process your request. Please see the logs for more details. |
|
Closed in favor of using error codes: #217 |
Fixes: #205