Skip to content

feat(tui): OCP_TUI_FULL_TOOLS gate — -p-equivalent tools for single-user TUI#135

Merged
dtzp555-max merged 2 commits into
mainfrom
feat/tui-full-tools-gate
Jun 2, 2026
Merged

feat(tui): OCP_TUI_FULL_TOOLS gate — -p-equivalent tools for single-user TUI#135
dtzp555-max merged 2 commits into
mainfrom
feat/tui-full-tools-gate

Conversation

@dtzp555-max

Copy link
Copy Markdown
Owner

Lets a single-user / trusted TUI deployment run a tool-using / MCP agent (e.g. an OpenClaw assistant) on the subscription pool — closing the gap that otherwise forces tool agents onto the metered -p pool after 2026-06-15.

What

When OCP_TUI_FULL_TOOLS=1, buildTuiCmd grants the interactive session the same tool surface as the -p A-path--allowedTools (+ optional --mcp-config / --dangerously-skip-permissions, from the same CLAUDE_ALLOWED_TOOLS/CLAUDE_MCP_CONFIG/CLAUDE_SKIP_PERMISSIONS env as buildCliArgs) — instead of the default MCP-walled, built-in-tools-only set. Default (gate unset) unchanged.

Why it's safe

The default tool wall (--strict-mcp-config --disallowedTools mcp__*) is a multi-tenant safety gate. TUI is hard-incompatible with AUTH_MODE=multi (server.mjs refuses to boot — existing guard), so opening tools here can never widen a guest's surface. Single-operator only.

Verified live (PI231, real OCP TUI path, 2026-06-02 spike)

  • built-in tools: claude created + read a file on the host (2 tool_use);
  • MCP: claude invoked a custom MCP server tool (mcp__spike__echo_marker) → returned its output;
  • billing: entrypoint=cli (subscription pool) with full tools + MCP;
  • completion: end_turn, no permission stall, no hang.

Tests / docs

+1 unit test (full-tools branch: --allowedTools present + MCP wall dropped; skip-permissions supersedes; mcp-config threaded). 195 pass. README: new OCP_TUI_FULL_TOOLS env-var entry.

ALIGNMENT.md

lib/tui/session.mjs, not server.mjs → hard requirements don't trigger. Mirrors buildCliArgs() permissions logic; documented Claude Code flags, not invented endpoints. cli.js N/A (Rule 2). ADR 0007 (A-path).

🤖 Generated with Claude Code

dtzp555 and others added 2 commits June 2, 2026 10:57
…ingle-user TUI

Lets a SINGLE-USER / trusted TUI deployment run a tool-using / MCP agent (e.g. an
OpenClaw assistant) on the subscription pool. When OCP_TUI_FULL_TOOLS=1, buildTuiCmd
grants the interactive session the SAME tool surface as the -p A-path — --allowedTools
(+ optional --mcp-config / --dangerously-skip-permissions, read from the same
CLAUDE_ALLOWED_TOOLS / CLAUDE_MCP_CONFIG / CLAUDE_SKIP_PERMISSIONS env as buildCliArgs)
— instead of the default MCP-walled, built-in-tools-only set.

Motivation: the default TUI tool wall (--strict-mcp-config --disallowedTools mcp__*)
exists for multi-tenant safety, but it also blocks a trusted single-operator agent from
its MCP tools — forcing tool-using agents onto the metered -p pool after 2026-06-15.
This gate resolves that for the single-user case.

Safe to gate ON only because TUI is hard-incompatible with AUTH_MODE=multi (server.mjs
refuses to boot, see existing guard), so this can NEVER widen a guest's tool surface.
Default (gate unset) is unchanged: MCP wall + built-in tools only.

Verified live on PI231 through the real OCP TUI path (spike 2026-06-02):
- built-in tools: claude created + read a file on the host (2 tool_use entries);
- MCP: claude invoked a custom MCP server's tool (mcp__spike__echo_marker) and returned
  its output;
- billing: entrypoint=cli (subscription pool) WITH full tools + MCP;
- completion: end_turn, no permission stall, no hang.

Tests: +1 (full-tools branch: --allowedTools present + MCP wall dropped; skip-permissions
supersedes; mcp-config threaded). 195 pass. README: new OCP_TUI_FULL_TOOLS env var entry.

ALIGNMENT.md: changes lib/tui/session.mjs, not server.mjs — server.mjs hard requirements
do not trigger. Mirrors buildCliArgs() permissions logic; the flags are documented Claude
Code CLI flags, not invented endpoints. cli.js citation N/A under Rule 2. ADR 0007 (A-path).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…er Finding 2)

Independent reviewer (APPROVE WITH CHANGES) caught that buildTuiCmd returns a SHELL
STRING (run by tmux via sh -c), unlike buildCliArgs which returns an argv array to
spawn(). Operator-supplied CLAUDE_ALLOWED_TOOLS can be a scoped specifier such as
"Bash(npm run test:*)" or "Read(~/**)", whose ( ) * ~ would break / inject the shell
command if pasted bare. Now shq() each allowed-tool token (operator-self-injection only —
guests cannot reach TUI per the multi-mode boot guard, but it's a real correctness bug).

Also: tightened the README OCP_TUI_FULL_TOOLS wording per reviewer Finding 1 — the precise
safety property is "no guest key can reach the TUI path (multi-mode boot is a hard exit)",
and noted the AUTH_MODE=shared + OCP_TUI_ALLOW_LAN trust model is unchanged.

Test: +scoped-specifier assertions (token shq'd; never appears unquoted). 195 pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dtzp555-max dtzp555-max merged commit 6d4751f into main Jun 2, 2026
5 checks passed
@dtzp555-max dtzp555-max deleted the feat/tui-full-tools-gate branch June 2, 2026 01:03
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.

2 participants