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
{{ message }}
Repository navigation
Commit cef1b65
Browse filesBrowse the repository at this point in the historyBrowse files
fix(table): apply filter and sort builder rules pinned on agent tool rows (#10083)
* fix(table): apply filter and sort builder rules pinned on agent tool rows
Agent tool rows store filter-builder and sort-builder values as JSON text, but
the tool param decoder treated both as plain strings. Table v2 then threw on the
parsed rules and the tool ran on the raw params with the model's own filter in
place of the pinned one (bulk update/delete included); sort rules went out
unconverted, and Table v1 ignored pinned builder rules entirely.
- decode filter-builder and sort-builder values as JSON
- pick the active canonical member from decoded values, so an emptied builder
('[]') no longer hides the model's filter
- ToolCallParamsError: Table mapper failures on a tool call fail the call
instead of falling back to raw params (agent and Pi local tools)
- keep tool-row builder rules as raw text for search/replace
* fix(table): fail a tool call whose v1 builder rules are corrupt
A pinned v1 builder value that does not decode to an array iterated as a string,
built nothing, and fell back to the model's filter. On a tool call it now fails
the call; an empty rule list keeps its model fallback. Also types the new test
helper params.
* fix(agent): record or skip a tool call whose block mapper rejects its params
A pending-call retry now records a ToolCallParamsError as a failed tool call
instead of aborting the continuation (other preparation refusals still abort),
and a Human-in-the-loop v2 notification whose mapper rejects its params is
skipped rather than sent with raw params.
* fix(agent): keep rejected argument values out of the tool-call error
ToolCallParamsError reaches the model before tool-result secret redaction, and a
mapper's message can quote the value it rejected after a {{SECRET}} placeholder
was resolved. The model now gets a static message; the original error stays on
cause for server logs.
@@ -948,6 +949,33 @@ export function toolCallArg<T>(
948
949
returnisToolCall(context) ? value : undefined
949
950
}
950
951
952
+
/**
953
+
* What the model is told when a block rejects a tool call's params. Deliberately static: a
954
+
* mapper's own message can quote the value it rejected (`Invalid Limit "…"`, a JSON parse
955
+
* snippet), and by then a model-written `{{SECRET}}` placeholder has been resolved to plaintext.
956
+
*/
957
+
constTOOL_CALL_PARAMS_REJECTED_MESSAGE=
958
+
'The tool was not run: its arguments could not be mapped to the tool inputs. Check the argument values (filters, sort, row data, limit) and try again.'
959
+
960
+
/**
961
+
* Runs a mapper body, and on a tool call turns any failure into a {@link ToolCallParamsError} so
962
+
* the call fails instead of running on the raw merged params. Use it where those raw params are
963
+
* unsafe: a pinned value under a block-only key (a filter builder) drops out of them, leaving the
964
+
* model's own argument for the same tool param in its place. The original error stays on `cause`
965
+
* for server logs; the canvas rethrows it unchanged.
0 commit comments