You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gentle_review{"operation":"answer-consent"} cannot be completed from a direct tool call when passing an object input.
In extensions/gentle-ai.ts:5567, parseReviewControllerParameters only serialized object inputs for START and ASSESS (#1573). Any other operation with a non-string input immediately threw:
Review controller input must be a string
Because Pi's tool execution runtime automatically parses JSON tool arguments into JavaScript objects, an LLM tool call responding to a consent/v3 envelope with input: {"consentBinding": "<opaque>", "answer": "granted"} arrives as an object and fails closed at parameter parsing.
Solution
Object Coercion for answer-consent:
In extensions/gentle-ai.ts (parseReviewControllerParameters), included value.operation === REVIEW_CONTROLLER_OPERATION.ANSWER_CONSENT in the serializeReviewJsonArgument branch alongside START and ASSESS.
Schema Description:
Updated tool parameter description in REVIEW_CONTROLLER_PARAMETER_FIELDS.input to reflect START/ASSESS/answer-consent.
Regression Coverage:
Added unit test in tests/review-json-arguments.test.ts verifying that answer-consent accepts object inputs, coerces them to serialized JSON strings, and dispatches to the controller without throwing.
Changes
File
Change
extensions/gentle-ai.ts
Allow object input coercion for answer-consent in parseReviewControllerParameters and update schema description
tests/review-json-arguments.test.ts
Unit test for answer-consent object coercion and execution; update operations filter
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.
📝 Walkthrough
The gentle_review input description and parser now accept object-form answer-consent input and serialize it as JSON. Tests cover validation, serialization, facade handling, and the resulting consent-binding-stale outcome.
Changes: Answer-consent input coercion
Layer / File(s)
Summary
Coercion and validation extensions/gentle-ai.ts, tests/review-json-arguments.test.ts, odd/tasks/fix-2375-gentle-review-answer-consent-input-coercion.md
The input description and parser now allow object-form answer-consent input and serialize it as JSON. Tests cover validation and facade handling. The task document records the implementation and verification details.
Object-form consent answers now pass parsing and reach the answer-consent path. No material merge-blocking issue is established.
Pre-merge checks: 5
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title clearly and concisely describes the main change: coercing object-form answer-consent input to a serialized string for review handling.
Linked Issues check
Issue #2375 requires direct gentle_review calls to accept object-form answer-consent input. The diff adds ANSWER_CONSENT to the object-serialization branch in parseReviewControllerParameters. …
Out of Scope Changes check
The changes stay within issue #2375. The source change enables answer-consent object coercion. The schema text documents that behavior. The tests cover validation, serialization, dispatch, and prese…
Docstring Coverage
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Full details: Linked Issues check
Explanation
Issue #2375 requires direct gentle_review calls to accept object-form answer-consent input. The diff adds ANSWER_CONSENT to the object-serialization branch in parseReviewControllerParameters. The diff updates the input schema description. The regression test validates { consentBinding, answer }, checks JSON serialization, and executes the controller without the previous string error. This meets the issue's minimum acceptance requirement. The test also confirms that execution reaches the controller; it does not claim an end-to-end granted START.
Full details: Out of Scope Changes check
Explanation
The changes stay within issue #2375. The source change enables answer-consent object coercion. The schema text documents that behavior. The tests cover validation, serialization, dispatch, and preservation of fail-closed behavior for other operations. The task document records the implementation and verification. No unrelated change is demonstrated.
Full details: Docstring Coverage
Explanation
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files. (2 skipped: 1 unsupported, 1 too large.)
✨ Finishing Touches
🧪 Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
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
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.
Closes #2375
Problem
gentle_review{"operation":"answer-consent"}cannot be completed from a direct tool call when passing an object input.In
extensions/gentle-ai.ts:5567,parseReviewControllerParametersonly serialized object inputs forSTARTandASSESS(#1573). Any other operation with a non-string input immediately threw:Because Pi's tool execution runtime automatically parses JSON tool arguments into JavaScript objects, an LLM tool call responding to a
consent/v3envelope withinput: {"consentBinding": "<opaque>", "answer": "granted"}arrives as an object and fails closed at parameter parsing.Solution
answer-consent:extensions/gentle-ai.ts(parseReviewControllerParameters), includedvalue.operation === REVIEW_CONTROLLER_OPERATION.ANSWER_CONSENTin theserializeReviewJsonArgumentbranch alongsideSTARTandASSESS.REVIEW_CONTROLLER_PARAMETER_FIELDS.inputto reflectSTART/ASSESS/answer-consent.tests/review-json-arguments.test.tsverifying thatanswer-consentaccepts object inputs, coerces them to serialized JSON strings, and dispatches to the controller without throwing.Changes
extensions/gentle-ai.tsanswer-consentinparseReviewControllerParametersand update schema descriptiontests/review-json-arguments.test.tsanswer-consentobject coercion and execution; update operations filterodd/tasks/fix-2375-gentle-review-answer-consent-input-coercion.mdVerification
Review controller input must be a stringintests/review-json-arguments.test.tswhen passing object input toanswer-consent.tests/review-json-arguments.test.tspassing.node --experimental-strip-types --test tests/review-controller.test.ts: 7/7 tests pass.npm run typecheck: 0 diagnostics, no regressions.Summary by CodeRabbit
answer-consentnow accepts either a JSON object or a serialized JSON object, making it easier to provide consent answers.