Chinesezjc
4806fdabab
fix(tools): collapse code-mode executor to run_code for model-direct calls
...
wireSchemas() already advertised only run_code under mode: 'code', but the
executor resolved every call through get(), which returns the full visible
map plus the reserved transport. A model could name a native tool directly
and bypass run_code entirely. Route the execution-path lookups through a
new private resolveExecution() that applies the mode collapse at the
operation boundary: model-direct calls under 'code' may only name run_code
(UNKNOWN_TOOL otherwise), while SDK sub-dispatches (parent token set) keep
every visible tool. get()/schemas() public semantics are unchanged.
The denial happens at createExecution, before the extensible policy
pipeline — pre-execute listeners, approval ask, and guards never observe
a call that is deterministically denied. A collapsed call honors the
pre-dispatch cancellation contract, routes aborted results through the
visible tool's finalizeContent, and captures the finalizer before
argument materialization.
Under code mode, a system-prompt/assemble listener filters out tool:*
guidance sections that told the model to call native tools directly.
The tools:sdk section and SDK types remain so programs can still use
all tools through run_code.
Fixes #1815
2026-08-11 22:40:19 +08:00
..
2026-08-09 11:33:14 +08:00
2026-07-25 16:43:07 +08:00
2026-08-09 11:33:14 +08:00
2026-08-09 11:02:16 +08:00
2026-08-09 01:21:12 +08:00
2026-08-09 11:02:16 +08:00
2026-08-11 15:23:05 +08:00
2026-08-11 15:23:05 +08:00
2026-08-10 13:07:46 +08:00
2026-08-04 17:36:14 +08:00
2026-07-25 15:11:17 +08:00
2026-08-04 17:36:14 +08:00
2026-08-09 03:20:17 +08:00
2026-08-08 15:28:35 +08:00
2026-08-09 03:20:17 +08:00
2026-08-09 11:33:14 +08:00
2026-07-31 19:21:16 +08:00
2026-08-09 11:33:14 +08:00
2026-08-09 17:26:57 +08:00
2026-08-09 17:26:57 +08:00
2026-08-05 10:57:53 +08:00
2026-08-11 15:23:05 +08:00
2026-08-11 15:23:05 +08:00
2026-08-04 17:36:14 +08:00
2026-08-04 17:36:14 +08:00
2026-07-24 12:21:10 +08:00
2026-08-04 17:36:14 +08:00
2026-08-09 11:33:14 +08:00
2026-07-30 21:14:03 +08:00
2026-08-09 11:33:14 +08:00
2026-08-09 11:33:14 +08:00
2026-08-08 02:15:44 +08:00
2026-08-09 11:33:14 +08:00
2026-08-09 15:35:02 +08:00
2026-08-09 15:35:02 +08:00
2026-08-09 15:35:02 +08:00
2026-08-09 21:10:59 +08:00
2026-08-09 21:10:59 +08:00
2026-08-09 21:10:59 +08:00
2026-08-09 11:33:14 +08:00
2026-08-06 20:34:57 +08:00
2026-08-09 11:33:14 +08:00
2026-08-11 18:01:25 +08:00
2026-08-11 18:01:25 +08:00
2026-08-11 18:01:25 +08:00
2026-07-30 14:34:08 +08:00
2026-07-30 14:34:08 +08:00
2026-07-30 14:34:08 +08:00
2026-08-09 15:35:02 +08:00
2026-08-09 15:35:02 +08:00
2026-08-09 15:35:02 +08:00
2026-08-09 11:02:16 +08:00
2026-08-08 01:10:57 +08:00
2026-08-09 11:02:16 +08:00
2026-08-09 16:39:34 +08:00
2026-08-09 15:35:02 +08:00
2026-08-09 11:02:16 +08:00
2026-08-09 11:33:14 +08:00
2026-08-07 22:52:19 +08:00
2026-08-09 11:33:14 +08:00
2026-08-09 21:10:59 +08:00
2026-08-09 21:10:59 +08:00
2026-08-09 21:10:59 +08:00
2026-08-08 11:49:42 -07:00
2026-08-08 11:49:42 -07:00
2026-08-08 11:49:42 -07:00
2026-08-09 11:33:14 +08:00
2026-08-02 12:45:36 +08:00
2026-08-09 11:33:14 +08:00
2026-08-09 11:02:16 +08:00
2026-07-31 15:06:27 +08:00
2026-08-09 11:02:16 +08:00
2026-08-09 11:02:16 +08:00
2026-07-30 17:59:37 +08:00
2026-08-09 11:02:16 +08:00
2026-08-09 11:02:16 +08:00
2026-07-30 15:06:28 +08:00
2026-08-09 11:02:16 +08:00
2026-08-09 21:10:59 +08:00
2026-08-09 21:10:59 +08:00
2026-08-09 21:10:59 +08:00
2026-08-09 13:46:14 +08:00
2026-08-04 15:12:11 +08:00
2026-08-09 13:46:14 +08:00
2026-08-09 11:33:14 +08:00
2026-07-31 01:36:20 +08:00
2026-08-09 11:33:14 +08:00
2026-08-09 21:10:59 +08:00
2026-08-09 21:10:59 +08:00
2026-08-09 21:10:59 +08:00
2026-08-09 11:33:14 +08:00
2026-07-31 05:41:45 -07:00
2026-08-09 11:33:14 +08:00
2026-08-09 17:26:57 +08:00
2026-08-09 17:26:57 +08:00
2026-08-09 17:26:57 +08:00
2026-08-07 14:48:26 +08:00
2026-08-07 14:48:26 +08:00
2026-08-07 14:48:26 +08:00
2026-08-09 11:33:14 +08:00
2026-08-02 12:51:10 +08:00
2026-08-09 11:33:14 +08:00
2026-08-09 11:33:14 +08:00
2026-08-08 15:30:08 +08:00
2026-08-09 11:33:14 +08:00
2026-08-09 11:33:14 +08:00
2026-08-02 05:58:45 -07:00
2026-08-09 11:33:14 +08:00
2026-08-09 11:02:16 +08:00
2026-08-06 17:46:18 +08:00
2026-08-09 11:02:16 +08:00
2026-08-09 11:33:14 +08:00
2026-08-02 13:26:08 +08:00
2026-08-09 11:33:14 +08:00
2026-08-10 23:45:04 +08:00
2026-08-10 23:45:04 +08:00
2026-08-10 23:45:04 +08:00
2026-08-09 13:46:14 +08:00
2026-08-09 01:25:24 +08:00
2026-08-09 13:46:14 +08:00
2026-08-09 14:33:57 +08:00
2026-08-04 16:21:55 +08:00
2026-08-09 14:33:57 +08:00
2026-08-09 11:02:16 +08:00
2026-08-07 23:45:28 +08:00
2026-08-09 11:02:16 +08:00
2026-08-09 16:39:34 +08:00
2026-08-09 15:35:02 +08:00
2026-08-09 16:39:34 +08:00
2026-08-09 16:39:34 +08:00
2026-08-09 15:35:02 +08:00
2026-08-09 16:39:34 +08:00
2026-08-09 11:02:16 +08:00
2026-08-07 22:52:19 +08:00
2026-08-09 11:02:16 +08:00
2026-08-09 11:02:16 +08:00
2026-08-05 12:21:09 +08:00
2026-08-09 11:02:16 +08:00
2026-08-09 21:10:59 +08:00
2026-08-09 21:10:59 +08:00
2026-08-09 21:10:59 +08:00
2026-08-07 23:25:42 +08:00
2026-08-07 23:25:42 +08:00
2026-08-07 23:25:42 +08:00
2026-08-11 12:38:57 +08:00
2026-08-11 12:38:57 +08:00
2026-08-11 12:38:57 +08:00
2026-08-11 19:25:41 +08:00
2026-08-11 19:25:41 +08:00
2026-08-11 19:25:41 +08:00
2026-08-09 11:33:14 +08:00
2026-08-07 22:04:04 +08:00
2026-08-09 11:33:14 +08:00
2026-08-09 15:35:02 +08:00
2026-08-09 15:35:02 +08:00
2026-08-09 11:33:14 +08:00
2026-08-09 11:33:14 +08:00
2026-08-06 19:36:15 +08:00
2026-08-09 11:33:14 +08:00
2026-08-09 21:11:00 +08:00
2026-08-09 21:10:59 +08:00
2026-08-09 21:11:00 +08:00
2026-08-11 22:40:19 +08:00
2026-08-11 22:40:19 +08:00
2026-08-11 22:40:19 +08:00
2026-08-11 17:43:09 +08:00
2026-08-11 17:43:09 +08:00
2026-08-11 17:43:09 +08:00
2026-08-09 17:44:34 +08:00
2026-08-09 17:44:34 +08:00
2026-08-09 17:44:34 +08:00
2026-08-10 20:34:45 +08:00
2026-08-10 20:34:45 +08:00
2026-08-10 20:34:45 +08:00
2026-08-11 15:51:03 +08:00
2026-08-11 15:51:03 +08:00
2026-08-11 15:51:03 +08:00
2026-08-11 15:35:32 +08:00
2026-08-11 15:35:32 +08:00
2026-08-11 15:35:32 +08:00
2026-08-10 14:35:13 +08:00
2026-08-10 14:35:13 +08:00
2026-08-10 14:35:13 +08:00
2026-08-11 19:25:42 +08:00
2026-08-11 19:25:42 +08:00
2026-08-11 19:25:42 +08:00
2026-08-10 22:19:14 +08:00
2026-08-10 22:19:14 +08:00
2026-08-10 22:19:14 +08:00
2026-08-11 16:48:41 +08:00
2026-08-11 16:48:41 +08:00
2026-08-11 16:48:41 +08:00
2026-08-11 20:04:32 +08:00
2026-08-11 20:04:32 +08:00
2026-08-11 20:04:32 +08:00
2026-08-11 14:26:18 +08:00
2026-08-11 14:26:18 +08:00
2026-08-11 14:26:18 +08:00