mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
Revert "fix(copilot): detect truncated write_workspace_file and guide LLM to source_path"
This reverts commit 8ae344863e.
This commit is contained in:
@@ -780,28 +780,6 @@ class WriteWorkspaceFileTool(BaseTool):
|
||||
|
||||
filename: str = kwargs.get("filename", "")
|
||||
if not filename:
|
||||
# When ALL parameters are missing, the most likely cause is
|
||||
# output token truncation: the LLM tried to inline a very large
|
||||
# file as `content`, the SDK silently truncated the tool call
|
||||
# arguments to `{}`, and we receive nothing. Return an
|
||||
# actionable error instead of a generic "filename required".
|
||||
has_any_content = any(
|
||||
kwargs.get(k) for k in ("content", "content_base64", "source_path")
|
||||
)
|
||||
if not has_any_content:
|
||||
return ErrorResponse(
|
||||
message=(
|
||||
"Tool call appears truncated (no arguments received). "
|
||||
"This happens when the content is too large for a "
|
||||
"single tool call. Instead of passing content inline, "
|
||||
"first write the file to the working directory using "
|
||||
"bash_exec (e.g. cat > /home/user/file.md << 'EOF'... "
|
||||
"EOF), then use source_path to copy it to workspace: "
|
||||
"write_workspace_file(filename='file.md', "
|
||||
"source_path='/home/user/file.md')"
|
||||
),
|
||||
session_id=session_id,
|
||||
)
|
||||
return ErrorResponse(
|
||||
message="Please provide a filename", session_id=session_id
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user