Skip to content

fix: check for NotFound error before auto-creating session (#751)#753

Open
indurireddy-TF wants to merge 2 commits intogoogle:mainfrom
indurireddy-TF:fix/751-check-notfound-error
Open

fix: check for NotFound error before auto-creating session (#751)#753
indurireddy-TF wants to merge 2 commits intogoogle:mainfrom
indurireddy-TF:fix/751-check-notfound-error

Conversation

@indurireddy-TF
Copy link
Copy Markdown
Contributor

@indurireddy-TF indurireddy-TF commented Apr 24, 2026

Please ensure you have read the contribution guide before creating a pull request.

Link to Issue or Description of Change

1. Link to an existing issue (if applicable):

2. Or, if no issue exists, describe the change:

If applicable, please follow the issue templates to provide as much detail as
possible.

Problem:
The code treats all network or database errors as a missing session, silently overwriting existing user data when a temporary failure occurs.

Solution:
Add an check so the framework only auto-creates a new session when it confirms the session actually does not exist.

Testing Plan

Please describe the tests that you ran to verify your changes. This is required
for all PRs that are not small documentation or typo fixes.

Unit Tests:

  • I have added or updated unit tests for my change.
  • All unit tests pass locally.

Please include a summary of passed go test results.

Manual End-to-End (E2E) Tests:

Checklist

  • I have read the CONTRIBUTING.md document.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have manually tested my changes end-to-end.
  • Any dependent changes have been merged and published in downstream modules.

Additional context

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the Runner to conditionally allow automatic session creation only when a NotFound error is returned. A review comment suggests that using gRPC-specific status codes for this check introduces unnecessary coupling and may fail to correctly identify wrapped errors or support non-gRPC service implementations.

Comment thread runner/runner.go Outdated
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.

AutoCreateSession should only create on NotFound, not on all Get errors

1 participant