Repository navigation
[18.0][FIX] ai_tool: date output schema and tool model metadata access - #118
Open
nobuQuartile wants to merge 2 commits into
Open
nobuQuartile wants to merge 2 commits into
nobuQuartile wants to merge 2 commits into
Conversation
The JSON Schema spec does not define 'date' as a valid type. Use 'string' with format 'date' instead, which is the correct way to represent a date in JSON Schema. (cherry picked from commit 3efa79a)
Building and dispatching a tool reads ir.model via model_id, which a plain internal user (base.group_user) cannot access. Resolve the model name with sudo() while keeping the actual tool execution under the caller's own permissions, so non-admin MCP keys can list and call tools. Add a regression test exercising a non-admin user through _get_tool_definition and _execute_tool. (cherry picked from commit 16beaa7)
|
The following commit authors need to sign the Contributor License Agreement: |
Author
|
Hi @ZachDreamZ, I forward-ported your commit from #89 ("fix: _ai_get_date output_schema uses invalid JSON Schema type 'date'") to 18.0 and 19.0 (#119), keeping you as the author. The CLA check is failing because the commit author email (zachdreambot@users.noreply.github.com) hasn't signed the OCA CLA. Could you sign it via the link in the bot comment above? Thank you for your contribution! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Forward-port of #89 and #94 to 18.0.
Fixes
_ai_get_date output schema (#89):
_ai_get_datedeclared{"type": "date"}, which is not a valid JSON Schema type. It now declares{"type": "string", "format": "date"}.Tool model metadata for non-admin users (#94):
_get_tool_definitionand_execute_toolreadmodel_id.model(ir.model), which a plain internal user cannot read, so building or running a tool raisedAccessError. The model name is now resolved withsudo(). The tool itself still runs with the caller's rights.Tests
Added
test_tool_non_admin_user: a user who has onlybase.group_usercan build the tool definition and execute a generic tool.@qrtl