Skip to content

test(tui-tests): run real engine-local approvals through Next on a PTY - #446

Open
BunsDev wants to merge 1 commit into
mainfrom
test/411-approval-journey
Open

BunsDev wants to merge 1 commit into
mainfrom
test/411-approval-journey

Conversation

@BunsDev

@BunsDev BunsDev commented Nov 4, 2026

Copy link
Copy Markdown
Member

Summary

Adds the real-terminal approval journey #411 asks for. Until now no journey reached the engine's own permission path, because the fake claude runs its own tools. A small local fake of the Messages API now asks the engine for real Bash calls.

Context

Changes

  • fake_anthropic.py: standard library only, bound to 127.0.0.1, with a fake key. It streams a tool_use for the prompt, then reports what the engine sent back, so the result is visible on screen. It logs each request's last message for checks.
  • 14_next_approval_journey.sh checks each decision three ways: on screen, by whether the command ran (a marker file), and by what the model was told.
Step Checked
New request Panel opens with deny highlighted, names the real enforcer, and nothing has run
Enter Refuses; command does not run; the model receives an error; row says denied
Rushed Enters and a burst of y as the panel arrives Command never runs
y Runs once; the model receives success
Next call Asks again
Escape Refuses; command does not run; the model receives an error
Y Runs; the same command runs again with no prompt; a different command still asks; settings unchanged

Validation

  • scripts/tui-tests/run.sh approval: 25 passed, 0 failed, 3 runs in a row under bash and once under zsh.
  • An earlier run failed on my own check of a success result, because the engine omits is_error on success. The check now requires that it is not true.
  • N/A: cargo fmt/check/clippy/test; no Rust changed.
  • Not run: Linux locally, Windows.

Refs #411

The fake claude used so far runs its own tools, so no journey reached the
engine's permission path. A small local fake of the Messages API now asks the
engine for real Bash calls, and each decision is checked on screen, by whether
the command ran, and by what the model was told.

Covers Enter and Escape denying, keys typed as the panel arrives, allow once
not carrying over, and an allow for the session staying out of settings and
not covering a different command. Engine-local evidence only.

Refs #411
@vercel

vercel Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
docs Ready Ready Preview Nov 4, 2026 2:13pm UTC

Request Review

This branch was successfully deployed

1 active deployment
Preview — a9105dd2 Deployed Nov 4, 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