Skip to content

Conversation

@google-labs-jules
Copy link
Contributor

This change addresses two issues:

  1. Admin Command Security: Non-admin users attempting to access admin-only commands (/ask, admin_dump, admin_migrate) now receive the default bot behavior (Natural Language Processing) instead of an explicit "permission denied" error. This implements a "silent fallback" strategy as requested.
  2. Bible Reference Parsing: Restored the mapping for the abbreviation "Am" -> "Amos" in the BibleBooks map. This fixes a regression where "Am 1" was failing to parse correctly due to the strict fuzzy matching rules for short words. The existing test case TestParseBibleReference_Strict/Am_1_(Am_->_Amos) now passes.

PR created automatically by Jules for task 8267790785180202745 started by @julwrites

- Modified `GetBibleAsk` in `pkg/app/ask.go` to fall back to `ProcessNaturalLanguage` if the user is not an admin, instead of returning an error message.
- Modified `DumpUserList` and `Migrate` in `pkg/app/admin.go` to similarly fall back to `ProcessNaturalLanguage`.
- Added `"am": "Amos"` to `BibleBooks` map in `pkg/app/bible_reference.go` to restore support for the "Am" abbreviation and fix the regression in parsing logic.
- Verified that `TestParseBibleReference_Strict` passes with this change.
@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

New to Jules? Learn more at jules.google/docs.

google-labs-jules bot and others added 2 commits December 8, 2025 23:56
- Updated `TestGetBibleAsk/Non-admin_user` to expect search results (fallback behavior) instead of permission denied, aligning with current code logic.
- Used `SetAPIConfigOverride` and `ResetAPIConfigCache` to inject mock API configuration for deterministic testing.
- Updated `TestGetBibleAsk/Admin_user` to verify specific mock responses.
Fix TestGetBibleAsk failures using mock API config
@julwrites julwrites marked this pull request as ready for review December 9, 2025 00:24
@julwrites julwrites merged commit 28b4a61 into staging Dec 9, 2025
1 check passed
@julwrites julwrites deleted the admin-fallback-and-amos-fix branch December 9, 2025 00:28
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.

2 participants