Repository navigation
fix(agent): refuse a single-record action given several records [PRD-1704] - #417
Conversation
…1704] A single-record action triggered on several ids ran on the first record only and answered success, since ActionContextSingle#get_record reads the first record. An API client, an MCP call or an approval request could send such a selection, and every record past the first was silently skipped. The action route now answers 422 for a single-record action whose selection names more than one id or is a select-all, before the permission check: no approval is asked for, approving a stored request runs nothing, and the form hooks refuse it too. Same fix as the Node agent (ForestAdmin/agent-nodejs#2028). Refs: PRD-1704 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Coverage Impact This PR will not change total coverage. Modified Files with Diff Coverage (1)
🛟 Help
|
hercemer42
left a comment
There was a problem hiding this comment.
Spec (PRD-1704): conforms.
…vate decoder [PRD-1704] Refs: PRD-1704 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The route refused a single action on several ids or a select-all but let an empty selection through: the action then ran on a match_none filter and answered success, or raised on a nil record. A single action now runs only on exactly one id, as the Node and Python agents do. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Scra3
left a comment
There was a problem hiding this comment.
Approved after /validator run 417-20261022165454-Scra3: nothing blocking posted, 0 preferential or code style, 0 suppressed below all.
## [1.46.4](v1.46.3...v1.46.4) (2026-10-23) ### Bug Fixes * **agent:** refuse a single-record action given several records [PRD-1704] ([#417](#417)) ([cdbbc7b](cdbbc7b))
|
🎉 This PR is included in version 1.46.4 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |

A single-record action triggered on several record ids now answers 422 ("This action can only be triggered on one record at a time.") instead of running on the first record and answering success. Same fix as the Node agent, ForestAdmin/agent-nodejs#2028.
Refs: PRD-1704
What changes
ActionContextSingle#get_recordreadsget_records[0]) and answered success, so the other records were skipped and nobody was told. After: 422, and nothing runs./hooks/load,/hooks/change,/hooks/search). Before: the form loaded against the first record. After: 422.A single-record action on exactly one id, and bulk and global actions, behave as before; a spec now pins the one-id case.
Definition of Done
General
Security
Squash message
🤖 Generated with Claude Code
Note
Reject multi-record selections for SINGLE-scope actions in
ActionsroutesRoutes::Action::Actions.ensure_single_record, which raisesUnprocessableErrorwhen a SINGLE-scope action receives more than one ID or a select-all/exclusion selection.get_record_selectionright after parsing selection IDs, before condition-tree building, related-data filtering, permission approval, and form loading.Changes since #417 opened
ForestAdminAgent::Routes::Action::Actions.ensure_single_recordto reject selections that do not contain exactly one record ID for SINGLE-scope actions [e92ccd1]Macroscope summarized 13185c0.