Skip to content

Using agent mode to create a new file has hiccups in the process #306

@johbo

Description

@johbo

I've observed agent mode to nearly get stuck when I ask the model to create a new file.

To reproduce I asked it to create a file with some dummy content. Eventually the model figured out to run "touch" instead of using the local tools. Used a clone of the aider-ce repository for the test run.

Session trace

───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Cost estimates may be inaccurate when using streaming and caching.
cecli v0.90.6.dev+less
Model: openrouter/mistralai/devstral-2512:free with agent edit format
Git repo: .git with 760 files
Repo-map: using 4096 tokens, files refresh
MCP servers configured: context7, local_tools
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Readonly: ../../.codex/AGENTS.md                                                                                                                                                                   
agent> Create a new file "test.md" with the content "hello world"                                                                                                                                  
Processing...


Tokens: 17k sent, 0 received.
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Tool Call: local_tools • UpdateTodoList

content:
- Create a new file 'test.md' with content 'hello world'

append:
True
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Run tools? (Y)es/(N)o/(A)ll/(S)kip all [Yes]: a                                                                                                                                                    

✅ Successfully appended to todo list in .aider.todo.txt (change_id: 4567058b)


Tokens: 17k sent, 0 received.
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Tool Call: local_tools • MakeEditable
Arguments: {"file_path": "test.md"}

⚠️ File 'test.md' not found


Tokens: 17k sent, 0 received.
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Tool Call: local_tools • InsertBlock

file_path:
test.md

content:
hello world

position:
top

Error in InsertBlock: File 'test.md' not found


Tokens: 17k sent, 0 received.
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Tool Call: local_tools • MakeEditable
Arguments: {"file_path": "test.md"}

⚠️ File 'test.md' not found
Let me create the file first using a different approach.

Tokens: 17k sent, 11 received.
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Tool Call: local_tools • Command
Arguments: {"command_string": "touch test.md"}

touch test.md
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Allow execution of this command? (Y)es/(N)o/(A)ll/(S)kip all/(D)on't ask again [Yes]:                                                                                                              
⚙️ Executing non-interactive shell command: touch test.md


Tokens: 17k sent, 0 received.
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Tool Call: local_tools • MakeEditable
Arguments: {"file_path": "test.md"}

📝 Added 'test.md' directly to editable context


Tokens: 17k sent, 0 received.
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Tool Call: local_tools • InsertBlock

file_path:
test.md

content:
hello world

position:
top

✅ Inserted block at start of test.md (change_id: d9132518)


Tokens: 17k sent, 0 received.
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Tool Call: local_tools • UpdateTodoList

content:
- Create a new file 'test.md' with content 'hello world' - DONE

append:
False

✅ Successfully updated todo list in .aider.todo.txt (change_id: 46577840)


Tokens: 18k sent, 0 received.
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Tool Call: local_tools • Finished
Arguments: {}
Task completed.

Tokens: 18k sent, 3 received.
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Unable to add /Users/johannes/wo/aider-ce/test.md: Cmd('git') failed due to: exit code(1)
  cmdline: git add /Users/johannes/wo/aider-ce/test.md
  stderr: 'The following paths are ignored by one of your .gitignore files:
test.md
hint: Use -f if you really want to add them.
hint: Disable this message with "git config set advice.addIgnoredFile false"'
Unable to commit: Cmd('git') failed due to: exit code(1)
  cmdline: git commit -m feat: add test.md file with hello world content --no-verify -- /Users/johannes/wo/aider-ce/test.md
  stderr: 'error: pathspec '/Users/johannes/wo/aider-ce/test.md' did not match any file(s) known to git'
Finished.
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Readonly: ../../.codex/AGENTS.md
Editable: test.md                                                                                                                                                                                  
agent> /report                                                                                                                                                                                     

Aider details

Aider-CE version: 0.90.6.dev+less
Python version: 3.13.7
Platform: macOS-14.7-arm64-arm-64bit-Mach-O
Python implementation: CPython
Virtual environment: Yes
OS: Darwin 23.6.0 (64bit)
Git version: git version 2.51.0

Configuration:
35turbo: False
4: False
4_turbo: False
4o: False
add_gitignore_files: False
agent_config: {
  "large_file_token_threshold": 12500,
  "skip_cli_confirmations": false
}

aiderignore: /Users/johannes/wo/aider-ce/.aiderignore
alias: None
analytics: False
analytics_disable: False
analytics_log: None
analytics_posthog_host: None
apply: None
apply_clipboard_edits: False
assistant_output_color: #0088ff
attribute_author: False
attribute_co_authored_by: False
attribute_commit_message_author: False
attribute_commit_message_committer: False
attribute_committer: False
auto_accept_architect: True
auto_commits: True
auto_lint: True
auto_load: False
auto_save: True
auto_save_session_name: auto-save
auto_test: False
cache_keepalive_pings: 0
cache_prompts: True
chat_history_file: /Users/johannes/wo/aider-ce/.aider.chat.history.md
chat_language: None
check_model_accepts_settings: True
check_update: True
code_theme: default
command_prefix: None
commit: False
commit_language: None
commit_prompt: None
completion_menu_bg_color: None
completion_menu_color: None
completion_menu_current_bg_color: None
completion_menu_current_color: None
config: None
context_compaction_max_tokens: 209715
context_compaction_summary_tokens: 4096
copy_paste: False
dark_mode: False
debug: False
deepseek: False
detect_urls: True
dirty_commits: True
disable_playwright: False
dry_run: False
edit_format: agent
editor: None
editor_edit_format: None
editor_model: None
enable_context_compaction: True
encoding: utf-8
env_file: ~/.aider.env
exit: False
fancy_input: True
file: None
files: []
git: True
git_commit_verify: False
gitignore: True
haiku: False
input_history_file: /Users/johannes/wo/aider-ce/.aider.input.history
install_main_branch: False
just_check_update: False
light_mode: False
line_endings: platform
linear_output: True
lint: False
lint_cmd: []
list_models: None
llm_history_file: None
load: None
map_cache_dir: .
map_max_line_length: 100
map_memory_cache: False
map_multiplier_no_files: 2
map_refresh: files
map_tokens: None
max_chat_history_tokens: None
mcp_servers: ['context7']
mcp_servers_file: None
mcp_transport: stdio
message: None
message_file: None
mini: False
model: openrouter/mistralai/devstral-2512:free
model_metadata_file: .aider.model.metadata.json
model_overrides: None
model_overrides_file: .aider.model.overrides.yml
model_settings_file: .aider.model.settings.yml
multiline: False
notifications: False
notifications_command: None
o1_mini: False
o1_preview: False
openai_api_base: None
openai_api_deployment_id: None
openai_api_type: None
openai_api_version: None
openai_organization_id: None
opus: False
preserve_todo_list: False
pretty: True
read: ['~/.codex/AGENTS.md']
reasoning_effort: None
restore_chat_history: False
set_env: []
shell_completions: None
show_diffs: False
show_model_warnings: True
show_prompts: False
show_release_notes: None
show_repo_map: False
skip_sanity_check_repo: False
sonnet: False
stream: True
subtree_only: False
suggest_shell_commands: True
test: False
test_cmd: []
thinking_tokens: None
timeout: None
tool_error_color: #FF2222
tool_output_color: None
tool_warning_color: #FFA500
tui: None
tui_config: None
tweak_responses: False
upgrade: False
use_enhanced_map: False
user_input_color: #00cc00
verbose: False
verify_ssl: True
vim: False
voice_format: wav
voice_input_device: None
voice_language: en
watch_files: False
weak_model: None
yes_always: None
yes_always_commands: False

cecli v0.90.6.dev+less
Model: openrouter/mistralai/devstral-2512:free with agent edit format
Git repo: .git with 760 files
Repo-map: using 4096 tokens, files refresh
MCP servers configured: context7, local_tools

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions