Repository navigation
Approve a proposal with corrected arguments - #74
Merged
Merged
Conversation
…d beside what ran
…turn a decision reports
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.
When one argument of a proposed write is slightly off (a time, a quantity, a typo in a name), the only way out today is Reject and a new message, which costs a turn and often comes back wrong in another field. filament-agents#108 asks for a form on the approval card; this is the engine half, with no Filament in it.
Approve with corrected arguments (packstub/filament-agents#108)
AgentChat::decide($call, true, $arguments)replaces the proposed arguments key by key and the turn runsDecision::edit()(in laravel/ai since 1.0). laravel/ai writes the edited arguments to the stored call, so the transcript, the card and the model's next reply all see what ran.act/decideendpoint never passes any, so nothing skips the form's validation. A call not waiting in that chat starts nothing; a rejection ignores them; arguments equal to the proposal approve as proposed.argumentsand what ran in the newapproved_arguments;ProposalDecidedgets$approvedArguments.A host can draw the decision
Packstub\Agents\Chat\ApprovalFormsis an optional interface besideChatHost(so the existing contract does not change):approvalView($tool)names a view that replaces Approve and Reject for that proposal, under the question. The chat listens for anagents-decidedbrowser event with the turn (ChatView::turn(), the same payload its own actions answer with) and follows it, as it does after its own decide.Upgrading
Run
php artisan migrate(addsapproved_argumentstoagent_tool_calls; the create migration has it too for fresh installs).Docs
docs/tools.md: "Correcting the arguments before approving".Tests
ApprovalEditsTest: the edited run and both sets of arguments in the log and the event, unchanged arguments, a call that is not waiting, a rejection, a held decision and one decided again, the turn payload, the HTTP endpoint ignoringarguments, and a host's approval view replacing the buttons. Full suite 172 passing, Pint clean,resources/distrebuilt. The filament-agents PR passes its suite against this branch.