Skip to content

(MOT-3980) fix(shell): expose coder functions in zero-config mode - #481

Merged
ytallo merged 1 commit into
mainfrom
fix/coder-zero-config-registration
Jul 11, 2026
Merged

ytallo merged 1 commit into
mainfrom
fix/coder-zero-config-registration

Conversation

@ytallo

@ytallo ytallo commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Make all nine coder::* file tools available when the shell worker uses its shipped zero-config policy.

The coder resolver now uses its existing working-directory plus /tmp fallback when fs.host_roots is empty, while explicit roots continue to override that fallback. Hot reloads can also move safely between configured roots and the zero-config fallback.

Why

The default shell configuration deliberately leaves fs.host_roots empty, but startup and reload contained separate jail checks that skipped the entire coder surface. As a result, healthy harness sessions had no coder file tools even though the resolver already supported a safe fallback.

Developer experience

A fresh local stack now exposes coder tools without requiring operators to discover and configure filesystem roots first. Harness-selected workspaces remain available through the trusted per-session filesystem scope.

This does not grant parent directories automatically or weaken shell::fs::* confinement. Attempts to leave the selected workspace still require an explicit folder-access grant.

Verification

  • cargo fmt --manifest-path shell/Cargo.toml -- --check
  • cargo test --manifest-path shell/Cargo.toml --lib configuration::tests:: — 17 passed
  • cargo test --manifest-path shell/Cargo.toml
  • Live zero-config smoke: all nine coder::* functions registered after restarting only the shell worker
  • Live session-scope smoke: coder::read-file read a file from the selected workspace outside the worker's static fallback roots

Fixes MOT-3980

Summary by CodeRabbit

  • Bug Fixes
    • Coder functionality now remains available when shell filesystem restrictions are widened or cleared.
    • Improved fallback behavior keeps coder file resolution limited to the current directory and /tmp when no explicit base paths are configured.
    • Coder configuration now remains consistent after shell configuration reloads.

@vercel

vercel Bot commented Jul 11, 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 11, 2026 9:31pm
workers-tech-spec Ready Ready Preview, Comment Jul 11, 2026 9:31pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 11, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e36734ae-7752-43ff-8a68-049bda864dba

📥 Commits

Reviewing files that changed from the base of the PR and between dc03845 and 0ea5893.

📒 Files selected for processing (2)
  • shell/src/configuration.rs
  • shell/src/main.rs

📝 Walkthrough

Walkthrough

The shell now builds and registers the coder code surface regardless of filesystem jail status. Unjailed configurations use fallback resolver roots consisting of the canonicalized current directory and /tmp, while coder base paths remain empty.

Changes

Coder surface availability

Layer / File(s) Summary
Fallback resolver roots
shell/src/configuration.rs
Unjailed configurations build coder snapshots using narrow fallback roots, with tests covering initial seeding and reload behavior.
Unconditional coder registration
shell/src/main.rs
Startup always stores coder cells in AppState and registers the coder::* code surface.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Poem

A rabbit hops where coder roots grow,
Through cwd and /tmp, in a tidy row.
No jail can hide the cells away,
They register bright at break of day.
“Narrow paths!” the bunny sings,
“Let every coder surface spring!”

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/coder-zero-config-registration

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

Copy link
Copy Markdown
Contributor

skill-check — worker

0 verified, 41 skipped (no docs/).

Layer Result
structure ✓
vale ✓
ai ✓
render ✓

Four for four. Nicely done.

This branch was successfully deployed

2 active deployments
Preview – workers-tech-spec — 0ea5893c Deployed Jul 11, 2026 by vercel[bot]
Preview – workers — 0ea5893c Deployed Jul 11, 2026 by vercel[bot]
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