Skip to content

fix: Improve mousehole fallback handling and UI feedback#25

Closed
masonfox wants to merge 1 commit intomainfrom
fix/mousehole-fallback-ui
Closed

fix: Improve mousehole fallback handling and UI feedback#25
masonfox wants to merge 1 commit intomainfrom
fix/mousehole-fallback-ui

Conversation

@masonfox
Copy link
Owner

Summary

Fixes the mousehole fallback UI to properly display when state.json is not found and Scurry falls back to the static token file.

Problem

When MOUSEHOLE_ENABLED=true but the state.json file doesn't exist (e.g., mousehole not running or volume mount incorrect), the UI showed:

  • Status: "Waiting for mousehole..."
  • Source: secrets/mam_api_token (confusing - shows static file but implies waiting for mousehole)
  • No indication that fallback is being used

Solution

API Changes (app/api/mam-token/route.js)

  • Added usingFallback: true flag to mouseholeInfo when falling back to static token
  • Added descriptive error message: "state.json not found, using fallback token file"
  • Ensures fallback response includes proper mousehole metadata

UI Changes (app/components/TokenManager.jsx)

  • Added yellow warning banner when usingFallback is true
  • Shows clear message: "Mousehole State File Not Found"
  • Explains that static fallback token is being used
  • Provides troubleshooting hint about volume mounts
  • Status now shows "Using fallback token" instead of "Waiting for mousehole..."
  • Displays correct source file path regardless of mode

After Fix

The UI now clearly shows:

  • ⚠️ Yellow warning banner explaining the fallback state
  • Status: "Using fallback token"
  • Source: secrets/mam_api_token (accurate)
  • Helpful hint to verify mousehole is running and volumes are mounted correctly

Testing

  • ✅ Mousehole enabled with valid state.json → Shows purple banner
  • ✅ Mousehole enabled without state.json → Shows yellow warning banner
  • ✅ Mousehole disabled → Shows normal manual management UI
  • ✅ Fallback token works correctly for API calls

Fixes the issue shown in production where the UI was confusing when mousehole wasn't available.

- Show fallback status in API response when state.json not found
- Add yellow warning banner when using fallback token
- Display correct source file path in fallback mode
- Improve status message to indicate fallback usage
- Add error message display in UI
@masonfox masonfox closed this Jan 23, 2026
@masonfox masonfox deleted the fix/mousehole-fallback-ui branch January 23, 2026 22:08
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.

1 participant

Comments