Skip to content

Comments

feat(cli): graceful fallback for keyring failures#5808

Merged
jamadeo merged 21 commits intoblock:mainfrom
sheikhlimon:feat/graceful-keyring-fallback
Jan 14, 2026
Merged

feat(cli): graceful fallback for keyring failures#5808
jamadeo merged 21 commits intoblock:mainfrom
sheikhlimon:feat/graceful-keyring-fallback

Conversation

@sheikhlimon
Copy link
Contributor

@sheikhlimon sheikhlimon commented Nov 19, 2025

Summary

Add automatic fallback to file-based storage when keyring is unavailable.
Provides user-friendly warnings and security guidance while maintaining configuration functionality.

  • Detect keyring-specific errors vs other failures
  • Auto-enable GOOSE_DISABLE_KEYRING for fallback
  • Work normally for all subsequent operations

Type of Change

  • Feature
  • Bug fix
  • Refactor / Code quality
  • Performance improvement
  • Documentation
  • Tests
  • Security fix
  • Build / Release
  • Other (specify below)

AI Assistance

  • This PR was created or reviewed with AI assistance

Testing

Related Issues

Fixes #5790

@sheikhlimon sheikhlimon marked this pull request as ready for review November 19, 2025 14:28
@sheikhlimon
Copy link
Contributor Author

sheikhlimon commented Nov 19, 2025

@DOsinga, this fix should work. I tested this using LLM, but wasn't able to replicate the said error on my machine as yesterday. Tried disabling even the keyring, but goose configure and ./target/debug/goose configure work no matter what I do. So I wasn't able to manually test it. Probably setting up a Docker or environment without keyring might trigger the error. But with my low-spec machine, that's quite hectic to do.
From OP's log, though, it looks like the original issue may still be happening on OP's end because the keyring wasn’t fully configured, and gcr-ssh-agent.socket doesn’t appear to have been properly enabled. They mentioned trying the fix, but based on the output, the socket was likely still disabled.

Edit: I added fallback for DBus error as well, look at the comment down below. I tested this manually. It seems to be working but this DCO check is killing me. I think I messed up my commit messages.

@sheikhlimon
Copy link
Contributor Author

sheikhlimon commented Nov 20, 2025

i guess we should handle this as well

Error: Failed to access keyring: Platform secure storage failure: DBus error: Using X11 for dbus-daemon autolaunch was disabled at compile time, set your DBUS_SESSION_BUS_ADDRESS instead

Edit: Managed to setup docker. Seems to be working.

🐚 
  ••/goose                                        [▴200][▿233]
󰪢 7s ❯ docker run --rm -it goose-test                     

This will update your existing config files
  if you prefer, you can edit them directly at /root/.config/goose

┌   goose-configure 
│
◇  What would you like to configure?
│  Configure Providers 
│
◇  Which model provider should we use?
│  OpenAI 
│
◇  Provider OpenAI requires OPENAI_API_KEY, please enter a value
│  ▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪
│
▲  Keyring service unavailable. Falling back to file-based storage for secrets.
│  
●  For better security, consider:
│  
●    - Fixing your system's keyring service
│  
●    - Or using environment variables for sensitive data
│  
◆  Configuration will continue normally with file-based storage
│  
◆  Successfully stored secret using file-based storage
│  
◇  Provider OpenAI requires OPENAI_HOST, please enter a value
│  https://api.openai.com
│
◇  Provider OpenAI requires OPENAI_BASE_PATH, please enter a value
│  v1/chat/completions
│
◇  Model fetch complete
│
◇  Select a model:
│  gpt-4o 
│
◒  Checking your configuration...                              └  Configuration saved successfully to /root/.config/goose/config.yaml

@sheikhlimon sheikhlimon force-pushed the feat/graceful-keyring-fallback branch 3 times, most recently from 72b571e to 0475b4c Compare November 20, 2025 10:30
@sheikhlimon sheikhlimon marked this pull request as draft November 20, 2025 11:39
@sheikhlimon sheikhlimon marked this pull request as ready for review November 20, 2025 21:34
@sheikhlimon sheikhlimon marked this pull request as draft November 21, 2025 05:12
@sheikhlimon sheikhlimon force-pushed the feat/graceful-keyring-fallback branch 2 times, most recently from 155c442 to c2011bc Compare November 21, 2025 09:07
@sheikhlimon sheikhlimon force-pushed the feat/graceful-keyring-fallback branch from caaa13e to 87cd6dc Compare November 21, 2025 11:26
@sheikhlimon sheikhlimon marked this pull request as ready for review November 21, 2025 11:28
@sheikhlimon sheikhlimon force-pushed the feat/graceful-keyring-fallback branch from 84c4a2f to 4f32af7 Compare November 21, 2025 11:53
@github-actions
Copy link
Contributor

This pull request has been automatically marked as stale because it has not had recent activity for 23 days.

What happens next?

  • If no further activity occurs, this PR will be automatically closed in 7 days
  • To keep this PR active, simply add a comment, push new commits, or add the keep-open label
  • If you believe this PR was marked as stale in error, please comment and we'll review it

Thank you for your contribution! 🚀

@github-actions github-actions bot added the stale label Dec 16, 2025
@sheikhlimon
Copy link
Contributor Author

Need a look on this

Copy link
Collaborator

@DOsinga DOsinga left a comment

Choose a reason for hiding this comment

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

I like this; but I think we should cut down on the logging and make sure we actually write the value to non keyring.

Signed-off-by: sheikhlimon <sheikhlimon404@gmail.com>
Signed-off-by: sheikhlimon <sheikhlimon404@gmail.com>
- Fixed type mismatches in keyring fallback functions
- Added ConfigError::FallbackToFileStorage variant
- Refactored keyring fallback logic into helper methods
- Avoided pre-checking secret existence during configure setup
- Added proper user feedback for file-based storage fallback

Signed-off-by: sheikhlimon <sheikhlimon404@gmail.com>
Added a reusable store_secret_with_fallback() function

Signed-off-by: sheikhlimon <sheikhlimon404@gmail.com>
Signed-off-by: sheikhlimon <sheikhlimon404@gmail.com>
Signed-off-by: sheikhlimon <sheikhlimon404@gmail.com>
Signed-off-by: sheikhlimon <sheikhlimon404@gmail.com>
Signed-off-by: sheikhlimon <sheikhlimon404@gmail.com>
@sheikhlimon sheikhlimon force-pushed the feat/graceful-keyring-fallback branch from 4f32af7 to 4a83e5a Compare December 16, 2025 17:18
Signed-off-by: sheikhlimon <sheikhlimon404@gmail.com>
Signed-off-by: sheikhlimon <sheikhlimon404@gmail.com>
Signed-off-by: sheikhlimon <sheikhlimon404@gmail.com>
Signed-off-by: sheikhlimon <sheikhlimon404@gmail.com>
Signed-off-by: sheikhlimon <sheikhlimon404@gmail.com>
Signed-off-by: sheikhlimon <sheikhlimon404@gmail.com>
Signed-off-by: sheikhlimon <sheikhlimon404@gmail.com>
Signed-off-by: sheikhlimon <sheikhlimon404@gmail.com>
@sheikhlimon sheikhlimon force-pushed the feat/graceful-keyring-fallback branch from 5a9ac4a to 0cb267e Compare December 16, 2025 19:57
Signed-off-by: sheikhlimon <sheikhlimon404@gmail.com>
@sheikhlimon sheikhlimon requested a review from DOsinga December 16, 2025 20:57
@github-actions github-actions bot removed the stale label Dec 17, 2025
Signed-off-by: sheikhlimon <sheikhlimon404@gmail.com>
Signed-off-by: sheikhlimon <sheikhlimon404@gmail.com>

# Conflicts:
#	crates/goose-cli/src/commands/configure.rs
@sheikhlimon sheikhlimon force-pushed the feat/graceful-keyring-fallback branch from 5c49a52 to 98808fa Compare January 6, 2026 10:07
@sheikhlimon
Copy link
Contributor Author

When merging with main, I encountered conflicts because configure.rs was refactored and logic was moved into separate functions. I accepted main’s structure rather than fighting the refactor.

As a result, the FallbackToFileStorage handling appears only in merge commit. It will not show up in my original commits, so please review the merge commit changes to configure.rs.

The core fallback logic in base.rs is unchanged from my original commits.

@DOsinga This PR has been open for a while, and ongoing changes in main are making it increasingly time-consuming to keep it rebased and conflict-free. A review or merge when convenient would be greatly appreciated.

…time

Signed-off-by: sheikhlimon <sheikhlimon404@gmail.com>
@sheikhlimon sheikhlimon force-pushed the feat/graceful-keyring-fallback branch from 1e0a8d0 to 01986c9 Compare January 6, 2026 12:09
@DOsinga
Copy link
Collaborator

DOsinga commented Jan 6, 2026

sorry forgot to press the button

Signed-off-by: sheikhlimon <sheikhlimon404@gmail.com>
@sheikhlimon sheikhlimon force-pushed the feat/graceful-keyring-fallback branch from e237e39 to 2cbda18 Compare January 6, 2026 15:56
@sheikhlimon
Copy link
Contributor Author

sorry forgot to press the button

No worries!

@jamadeo jamadeo merged commit c6c2d74 into block:main Jan 14, 2026
18 checks passed
lifeizhou-ap added a commit that referenced this pull request Jan 14, 2026
* main:
  fix: require auth when running goose on non loopback address (#6478)
  chore(deps): bump hono from 4.11.3 to 4.11.4 in /ui/desktop (#6485)
  feat(cli): graceful fallback for keyring failures (#5808)
  fix: support global .gooseignore and negation patterns (#6157)
  docs: manual config for jetbrains (#6490)
  fix: Recipe slash command doesn't work with single optional parameter (#6235)
  fix(openrouter): Handle Gemini thoughtSignature for tool calls (#6370)
  docs: fix extensions page (#6484)
  Allow customizing the new line keybinding in the CLI (#5956)
  Ask for permission in the CLI (#6475)
  docs: add Ralph Loop tutorial for multi-model iterative development (#6455)
  Remove gitignore fallback from gooseignore docs (#6480)
  fix: clean up result recording for code mode (#6343)
  fix(code_execution): handle model quirks with tool calls (#6352)
  feat(ui): support prefersBorder option for MCP Apps (#6465)
  fixed line breaks (#6459)
  Use Intl.NumberFormat for token formatting in SessionsInsights (#6466)
  feat(ui): format large and small token counts for readability (#6449)
  fix: apply subrecipes when using slash commands (#6460)
zanesq added a commit that referenced this pull request Jan 14, 2026
…ased

* 'main' of github.com:block/goose:
  fix(code_execution): serialize record_result output as JSON (#6495)
  perf(google): avoid accumulating thoughtSignatures across conversation history (#6462)
  fix(openai): make tool_call arguments optional and fix silent stream termination (#6309)
  fix: Improve error messages for invalid tool calls (#6483)
  fix: require auth when running goose on non loopback address (#6478)
  chore(deps): bump hono from 4.11.3 to 4.11.4 in /ui/desktop (#6485)
  feat(cli): graceful fallback for keyring failures (#5808)
  fix: support global .gooseignore and negation patterns (#6157)
  docs: manual config for jetbrains (#6490)
  fix: Recipe slash command doesn't work with single optional parameter (#6235)
  fix(openrouter): Handle Gemini thoughtSignature for tool calls (#6370)
  docs: fix extensions page (#6484)
  Allow customizing the new line keybinding in the CLI (#5956)
  Ask for permission in the CLI (#6475)
  docs: add Ralph Loop tutorial for multi-model iterative development (#6455)
  Remove gitignore fallback from gooseignore docs (#6480)
  fix: clean up result recording for code mode (#6343)
  fix(code_execution): handle model quirks with tool calls (#6352)
  feat(ui): support prefersBorder option for MCP Apps (#6465)
  fixed line breaks (#6459)
@sheikhlimon sheikhlimon deleted the feat/graceful-keyring-fallback branch January 18, 2026 19:34
fbalicchia pushed a commit to fbalicchia/goose that referenced this pull request Jan 23, 2026
Signed-off-by: sheikhlimon <sheikhlimon404@gmail.com>
Signed-off-by: fbalicchia <fbalicchia@cuebiq.com>
raj-subhankar pushed a commit to raj-subhankar/goose that referenced this pull request Feb 14, 2026
Signed-off-by: sheikhlimon <sheikhlimon404@gmail.com>
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.

goose-configure CLI: add provider failed

3 participants