fix: configure codex with a longer timeout

refactor: param names
This commit is contained in:
Fahad
2025-10-21 10:35:44 +04:00
parent 04132f1459
commit d2773f488a
47 changed files with 232 additions and 194 deletions

View File

@@ -29,7 +29,7 @@ COMMON_FIELD_DESCRIPTIONS = {
"files, and findings so the agent can resume seamlessly."
),
"images": "Optional absolute image paths or base64 blobs for visual context.",
"files": "Optional absolute file or folder paths (do not shorten).",
"absolute_file_paths": "Full paths to relevant code",
}
# Workflow-specific field descriptions

View File

@@ -667,7 +667,7 @@ class BaseTool(ABC):
"""
# Only validate files/paths if they exist in the request
file_fields = [
"files",
"absolute_file_paths",
"file",
"path",
"directory",
@@ -885,7 +885,7 @@ class BaseTool(ABC):
def handle_prompt_file(self, files: Optional[list[str]]) -> tuple[Optional[str], Optional[list[str]]]:
"""
Check for and handle prompt.txt in the files list.
Check for and handle prompt.txt in the absolute file paths list.
If prompt.txt is found, reads its content and removes it from the files list.
This file is treated specially as the main prompt, not as an embedded file.
@@ -895,7 +895,7 @@ class BaseTool(ABC):
mechanism to bypass token constraints while preserving response capacity.
Args:
files: List of file paths (will be translated for current environment)
files: List of absolute file paths (will be translated for current environment)
Returns:
tuple: (prompt_content, updated_files_list)
@@ -983,7 +983,7 @@ class BaseTool(ABC):
f"MANDATORY ACTION REQUIRED: The prompt is too large for MCP's token limits (>{MCP_PROMPT_SIZE_LIMIT:,} characters). "
"YOU MUST IMMEDIATELY save the prompt text to a temporary file named 'prompt.txt' in the working directory. "
"DO NOT attempt to shorten or modify the prompt. SAVE IT AS-IS to 'prompt.txt'. "
"Then resend the request with the absolute file path to 'prompt.txt' in the files parameter (must be FULL absolute path - DO NOT SHORTEN), "
"Then resend the request, passing the absolute file path to 'prompt.txt' as part of the tool call, "
"along with any other files you wish to share as context. Leave the prompt text itself empty or very brief in the new request. "
"This is the ONLY way to handle large prompts - you MUST follow these exact steps."
),
@@ -991,7 +991,7 @@ class BaseTool(ABC):
"metadata": {
"prompt_size": len(text),
"limit": MCP_PROMPT_SIZE_LIMIT,
"instructions": "MANDATORY: Save prompt to 'prompt.txt' in current folder and include absolute path in files parameter. DO NOT modify or shorten the prompt.",
"instructions": "MANDATORY: Save prompt to 'prompt.txt' in current folder and provide full path when recalling this tool.",
},
}
return None

View File

@@ -45,10 +45,10 @@ class SchemaBuilder:
# Simple tool-specific field schemas (workflow tools use relevant_files instead)
SIMPLE_FIELD_SCHEMAS = {
"files": {
"absolute_file_paths": {
"type": "array",
"items": {"type": "string"},
"description": COMMON_FIELD_DESCRIPTIONS["files"],
"description": COMMON_FIELD_DESCRIPTIONS["absolute_file_paths"],
},
}