Skip to content

feat(mcp): job_wait, write_file as user, leaner outputs - #160

Merged
NovusEdge merged 1 commit into
mainfrom
qol/mcp-tools
Sep 29, 2026
Merged

NovusEdge merged 1 commit into
mainfrom
qol/mcp-tools

Conversation

@NovusEdge

Copy link
Copy Markdown
Owner

MCP quality-of-life changes from the agent audit (items 4, 5, 7, 8, 9, 10, 12, 15).

Behaviour change: write_file now writes as the guest ssh user, not root. Files under the user's home now belong to that user. Paths only root can write fail with access_denied. as_root=true restores the old behaviour and needs agent_access = exec; at manage it is refused with access_denied. Noted in the tool description, docs and CHANGELOG.

Other changes:

  • job_status/list_jobs: exit_code only once exited; list_jobs has state (unknown when guest files are gone). New job_wait. job_kill on a non-running job returns its state with signaled:false.
  • Guest errors: ENOENT maps to not_found, EACCES to access_denied; unknown job id not_found, malformed usage.
  • write_file: parents, returns {path, bytes, mode}; append keeps the file mode unless one is passed.
  • update: unknown recipe is not_found; pending_restart; description no longer says stopped VM. VM health is not ok while a configured recipe is unapplied (core/vm.go).
  • create description states mode values and ram/cpu/disk defaults (built from core constants). A cloud image refuses a non-cloud mode rather than ignoring it, so the text says that.
  • Leaner outputs: destroy, wait (healthy only after healthy=true), octal mode and owner in stat/list_dir (basenames), ANSI and CR stripped from logs, list_recipes drops health scripts (has_health; recipe_schema has the script), svc_status adds active/enabled.

Tested with unit tests on the ssh fake; no VM was booted. Live checks needed: job_wait against a real job, list_jobs state after a reboot, write_file as user and as_root on a real guest (ownership), svc_status enabled on alpine and systemd guests, stat owner format on busybox, console log stripping on real output.

@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 12 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 0f6ab786-319f-4c1c-938f-df92f4c835c4

📥 Commits

Reviewing files that changed from the base of the PR and between fd5b6e7 and ca1df19.

📒 Files selected for processing (19)
  • CHANGELOG.md
  • docs/reference/mcp.md
  • internal/cli/wire/dto.go
  • internal/core/vm.go
  • internal/core/vm_test.go
  • internal/mcpsrv/access.go
  • internal/mcpsrv/access_test.go
  • internal/mcpsrv/jobs.go
  • internal/mcpsrv/redact_test.go
  • internal/mcpsrv/table_test.go
  • internal/mcpsrv/tools_exec.go
  • internal/mcpsrv/tools_exec_test.go
  • internal/mcpsrv/tools_guest.go
  • internal/mcpsrv/tools_guest_test.go
  • internal/mcpsrv/tools_read.go
  • internal/mcpsrv/tools_read_test.go
  • internal/mcpsrv/tools_recipe.go
  • internal/mcpsrv/tools_vm.go
  • internal/mcpsrv/tools_vm_test.go

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.

Jobs: job_status omits exit_code until exit, job_wait blocks and returns
the output tail, list_jobs carries state, job_kill on a non-running job
reports its state instead of signaling.

Guest tools: missing paths answer not_found and permission failures
access_denied; unknown job ids answer not_found, malformed ones usage.
write_file now writes as the ssh user, takes parents, and takes as_root,
which needs exec access.

update validates recipe names, works on running VMs and reports
pending_restart; VM health is not ok while a recipe is unapplied.
create documents mode values and defaults.

Outputs: write_file, destroy, wait, stat, list_dir, logs, list_recipes
and svc_status return leaner or more parseable results.

Signed-off-by: NovusEdge <novusedge0@gmail.com>
@NovusEdge
NovusEdge merged commit 54a2ef4 into main Sep 29, 2026
8 of 9 checks passed
@NovusEdge
NovusEdge deleted the qol/mcp-tools branch September 29, 2026 18:36
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