Skip to content

(MOT-3898) feat: create new files in the current folder by default#445

Closed
ytallo wants to merge 1 commit into
mainfrom
feat/new-files-current-folder
Closed

(MOT-3898) feat: create new files in the current folder by default#445
ytallo wants to merge 1 commit into
mainfrom
feat/new-files-current-folder

Conversation

@ytallo

@ytallo ytallo commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

New files created without an explicit folder now land in the session's working directory. The path resolution already anchored scoped relative paths there — but every model-facing instruction still pointed at the primary jail root, so agents kept writing files into the worker install path. This fixes the instructions and contract text end to end.

Harness

  • The working-directory system-prompt aid now instructs instead of merely stating: "Your working directory is {dir}. Create new files there by default — relative paths resolve against it; only write elsewhere when the user names another location."
  • prompts/default.txt and prompts/cli.txt: the coder routing paragraph gains the same where-new-files-go sentence.

Provider prompts

  • anthropic / openai / openai-codex / xai identity prompts: the code-file routing clause now says new files land in the working directory by default.

Shell

  • All coder::* function descriptions and the create/move/delete path field docs said "relative to the primary allowed root" — wrong for scoped sessions, where relatives anchor at the session root. Reworded across create/read/search/list-folder/tree/update/move/delete plus the shell::exec cwd doc (omitted cwd runs in the session working directory when scoped).
  • coder::info is now session-aware: it accepts the harness-stamped scope (schema-hidden like its siblings) and reports session_root, so "where may I write?" answers with the session anchor rather than only the jail root.
  • Path safety unchanged: containment (C215/C218), denylist, and grants behave exactly as before. Schema goldens regenerated; fs_scope remains absent from every published schema.

Tests

  • Shell: 1294 pass, including new session_root_reflects_scope (scoped → canonical echo, unscoped → none, outside-roots → none).
  • Harness: 178 pass with the updated aid-line assertions.

Fixes MOT-3898
Refs MOT-3897

Point every model-facing instruction at the session working directory:
the system-prompt working-directory aid now tells the agent to create
new files there, the harness and provider prompts say where new files
belong, coder::*/shell::exec contract docs describe scoped relative-path
anchoring instead of the primary-root-only wording, and coder::info
reports the effective session root.
@vercel

vercel Bot commented Jul 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
workers Ready Ready Preview, Comment Jul 7, 2026 7:56pm
workers-tech-spec Ready Ready Preview, Comment Jul 7, 2026 7:56pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@ytallo, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 59 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 67d664cc-55fe-4e0a-894d-c7db9de8f4ba

📥 Commits

Reviewing files that changed from the base of the PR and between 9aeb2e1 and 2bda272.

📒 Files selected for processing (28)
  • harness/prompts/cli.txt
  • harness/prompts/default.txt
  • harness/src/turn_loop.rs
  • provider-anthropic/prompts/identity.txt
  • provider-openai-codex/prompts/identity.txt
  • provider-openai/prompts/identity.txt
  • provider-xai/prompts/identity.txt
  • shell/src/code/functions/create_file.rs
  • shell/src/code/functions/delete_file.rs
  • shell/src/code/functions/info.rs
  • shell/src/code/functions/list_folder.rs
  • shell/src/code/functions/mod.rs
  • shell/src/code/functions/move_file.rs
  • shell/src/code/functions/read_file.rs
  • shell/src/code/functions/search.rs
  • shell/src/code/functions/tree.rs
  • shell/src/code/functions/update_file.rs
  • shell/src/functions/types.rs
  • shell/tests/common/world.rs
  • shell/tests/golden/schemas/coder.create-file.json
  • shell/tests/golden/schemas/coder.delete-file.json
  • shell/tests/golden/schemas/coder.info.json
  • shell/tests/golden/schemas/coder.list-folder.json
  • shell/tests/golden/schemas/coder.move.json
  • shell/tests/golden/schemas/coder.read-file.json
  • shell/tests/golden/schemas/coder.search.json
  • shell/tests/golden/schemas/coder.tree.json
  • shell/tests/golden/schemas/coder.update-file.json
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/new-files-current-folder

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

skill-check — worker

0 verified, 38 skipped (no docs/).

Layer Result
structure
vale
ai
render

Four for four. Nicely done.

@ytallo ytallo closed this Jul 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant