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 53cd723
Browse filesBrowse the repository at this point in the historyBrowse files
refactor: rename read/write/edit file_path param to path (LibreChat-AI#250)
* feat(coding-tools)!: rename read/write/edit `file_path` param to `path`
Models intermittently emit the very common `path` instead of `file_path` for
read_file/write_file/edit_file, which fails Zod validation ("Received tool input
did not match expected schema") and derails the agent run — the model then retries
or returns empty. Observed reliably with Kimi K2 via Fireworks/ClickHouse Inference
(the investigator dies right after the first tool call).
Rather than coerce the alias at every execution path, align the schema with what
models actually emit — and with the sibling search tools (grep_search /
glob_search / list_directory), which already use `path`. Now every built-in coding
tool takes its file/dir target in `path`.
- ReadFileToolSchema + Local{Read,Write,Edit}FileToolSchema: `file_path` -> `path`
- handlers read `input.path`
- workspace-policy extractors collapse to a single `path` extractor for all tools
- tests updated
BREAKING CHANGE: the read_file/write_file/edit_file parameter is now `path`
(was `file_path`). Consumers that construct or read these tool-call args must update.
Verified end-to-end against ClickHouse Inference (kimi-k2p7-code): a real investigator
loop goes 4/10 -> 10/10 with no coercion. Tool + hook suites green (the one failing
suite, directToolHITLResumeScope, fails identically on clean main — pre-existing).
* fix(cloudflare-ptc): rename generated read/write/edit helpers to `path`
Codex (LibreChat-AI#250): the Cloudflare Sandbox programmatic runners generate in-sandbox
read_file/write_file/edit_file helpers that still took `file_path` (Python defs +
the JS `payload.file_path` reads), so `write_file(path=...)` failed only in the
Cloudflare programmatic path after the schema switched to `path`. Rename the tool
wrappers' param to `path` (the internal `_resolve`/`_is_within_workspace` utils and
the code-execution temp-file locals keep `file_path` — unrelated).
Copy file name to clipboardExpand all lines: src/tools/ReadFile.ts
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -22,13 +22,13 @@ CONSTRAINTS:
22
22
exportconstReadFileToolSchema={
23
23
type: 'object',
24
24
properties: {
25
-
file_path: {
25
+
path: {
26
26
type: 'string',
27
27
description:
28
28
'Path to the file. For skill files: "{skillName}/{path}" (e.g. "pdf-analyzer/src/utils.py"). For code execution output: the path as returned by the execution tool.',
0 commit comments