1jehuang / 1jehuang/jcode

Route codemode run_code APPROVAL_REQUIRED folders through the permission system

Open
#953 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs-info triage: unclear
Dominant language
Rust
Stars
19.9k
Forks
2.3k
Avg merge
2d 7h
Merged PRs (30d)
30

Description

What

codemode's run_code can mount any folder read-only per call, but folders outside a configured allow-list return APPROVAL_REQUIRED with no path for the user to actually approve them. jcode already has a permission system; this would wire the two together.

Suggested change

In the MCP tool-result path, detect a codemode run_code result beginning APPROVAL_REQUIRED: and route it through SafetySystem::request_permission (crates/jcode-base/src/safety.rs):

  • PermissionRequest { action: "mcp_mount", description: <path>, urgency: High, wait: true, ... }
  • Approved → re-invoke run_code with that path; Denied → surface the reason to the model

Edge cases

  • String-prefix detection is hacky; a structured approval_required result from codemode would be cleaner.
  • "Approved once" should not persist into codemode's allow-list — needs a one-shot pass, not a config write.
  • wait: true blocking inside a tool call (vs ambient) is unverified.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in the MCP tool-result path and read SafetySystem::request_permission in crates/jcode-base/src/safety.rs, then trace how codemode run_code returns APPROVAL_REQUIRED. Implement the permission request and approval or denial flow, while verifying whether wait: true can block inside a tool call. Done means an approved path is retried once without changing codemode's allow-list, and denial reaches the model.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, security
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.