Skip to content

Try by hand: terminal features, MCP login, plugins, sbx engine with allowlist #22

Open

Description

@blockmandev

Why

These features are covered by unit and flow tests but have never been used by a person in a real terminal or against real services. Each needs a few minutes. Report anything odd here, or open a bug.

Build first: cargo build --release, then use target/release/incode. Settings go in ~/.incode/admin.json.

Terminal

  • Notifications (notify: auto | bell | desktop | off, notify_after_secs, notify_command). Run a turn longer than 10 s, then leave a permission question open. On Windows, check that the toast (BurntToast or WinRT) appears; macOS uses osascript and Linux notify-send.
  • Status line (statusline_command): a script that reads the JSON on stdin and prints one line. Check it renders, and that a slow script (over 1.5 s) keeps the last good line.
  • /vim and "editing_mode": "vi": Esc, h l w b e 0 ^ $ x X D C s S dd cc i a I A j k, Enter from normal mode.
  • ~/.incode/keybindings.toml, e.g. "ctrl-l" = "clear-line".
  • /cost: the numbers look right for your model, and an unpriced model says so.

Commands and review

MCP and plugins

  • A project .mcp.json server: first-use approval in the REPL, then incode mcp list.
  • incode mcp login <name> against a real remote server that needs OAuth. Check the browser opens on each OS (Windows uses cmd /c start with & escaped as ^&; macOS open), then use a tool, then incode mcp logout <name>. Logout only forgets the token locally; there is no revocation call. (Windows verified 2026-11-13 against GitHub's remote MCP server; macOS open not run.)
  • incode plugin add <git url>, then incode plugin update. On a failed fetch the installed copy must stay.

Sandbox

Known small gaps (fix if they bite)

  • An Agent sub-agent runs under its own definition's tools, not the custom command's allowed-tools.
  • The allowed-tools parse-warning and not-enforced notices appear after the turn, not before.
  • A custom command's model is only named in the REPL, not switched to.
  • MCP OAuth: no token revocation on logout; client_secret_basic isn't supported; login proceeds when the server's metadata lists no PKCE methods (lenient).
  • MCP: a server that only speaks legacy SSE won't connect (sse is tried over Streamable HTTP).

Generated by Claude Code

Activity

  1. blockmandev commented on Oct 24, 2026

    @blockmandev
    MemberAuthor

    Tried by hand on Windows with the official v0.1.0

    Each check ran in a scratch folder, with a control where one made sense.

    Item Result
    incode plugin add <git url>, then incode plugin update Pass. Installed 1.0.0; after a new commit update said 1.0.0 → 1.1.0. With the source deleted, update failed and the installed 1.1.0 stayed, with no half-finished folder left behind.
    Custom command with allowed-tools: Read (Claude Code route) Pass, with a control. The command asked for a file to be written: the write was refused and no file appeared. The same command without allowed-tools did write it. The @src/file.rs include reached the model. $ARGUMENTS/$1 were not echoed back by the model; they are covered by the unit test arguments_are_substituted.
    incode review on a change Pass. It found both planted bugs (an off-by-one, a swallowed error) in 31 s. Every file's hash was the same before and after, and no file appeared.
    Project .mcp.json server, incode mcp list / approve Pass for the commands. needs approval, then approved. Changing the server's command asked for approval again. The first-use prompt inside the interactive terminal is still to try.

    Bug found and fixed: #67 (merged)

    A file saved with a byte-order mark, as Windows PowerShell 5.1 and some editors save it, broke incode's readers of hand-written files:

    • Plugins: the plugin was refused with "name is missing".
    • Custom commands: allowed-tools was silently not applied.
    • Settings files: admin.json, mcp.json and the project's permission settings were refused.

    One shared reader now handles it. There are 8 tests for it, and all 8 fail when the fix is switched off.

    Still for the owner (needs a real terminal, a browser login, or admin)

  2. blockmandev commented on Oct 24, 2026

    @blockmandev
    MemberAuthor

    Terminal checks, now done by the agent in a real (pseudo) console. The shell the agent runs in is not a terminal, so the REPL was driven through Windows' pseudo-console (ConPTY): a real console from incode's side, with keys typed and the screen read back. The official build was used, with a scratch settings folder.

    • /vim / "editing_mode": "vi": pass. The input line, frame by frame:

      • hello world typed;
      • Esc: the box shows NORMAL;
      • 0x gives ello world;
      • wD gives ello ;
      • dd clears the line;
      • i returns to insert mode;
      • /quit exits ("Goodbye!").

      (dw does nothing, as designed: only dd and cc combine with an operator.)

    Next with the same harness: keybindings (ctrl-l = clear-line), the status line (rendering, and a slow script keeping the last line), notifications (bell or a notify command after a long turn), /cost.

    Still for the owner:

    • MCP OAuth login: needs a browser and a real account.
    • sbx allowlist: needs sbx setup-windows as admin.
    • RenderPdf on Ubuntu 23.10+: needs a Linux machine.
  3. blockmandev commented on Nov 13, 2026

    @blockmandev
    MemberAuthor

    sbx allowlist (now insbx): checked on Windows natively, with the insbx-offline account set up. Under --net proxy with only api.anthropic.com allowed, Claude Code answered. Every other host it tried was refused and logged: api.githubcopilot.com, api.greptile.com, mcp.trendkia.com, mcp-proxy.anthropic.com, and Datadog telemetry. With no host allowed, api.anthropic.com was refused until the wall limit. A write outside the project failed with EPERM. Details are in the PR for #40.

  4. blockmandev commented on Nov 13, 2026

    @blockmandev
    MemberAuthor

    RenderPdf on Ubuntu 23.10+: verified on GitHub's ubuntu-latest (Ubuntu 24.04), in PR #91's new CI step, which shows the output on every run. The runner's Edge can't build its own sandbox, and incode says so and what to do instead of printing nothing: "the browser exited with signal 6 (SIGABRT) and printed no PDF; it could not start its own sandbox on this machine (a setuid sandbox helper that is not installed as root, or unprivileged user namespaces turned off, as Ubuntu 23.10 and later do by default); fix the browser's sandbox or set pdf_renderer to another program". The headless-browser tests skip there because none is installed.

  5. blockmandev commented on Nov 13, 2026

    @blockmandev
    MemberAuthor

    Terminal checks, round two, by the agent in a real (pseudo) console. Same method as the /vim check: incode was spawned in a Windows pseudo-console (ConPTY, via pywinpty), keys were typed, and the screen was read back through a terminal emulator. Build: current origin/main (1c7ae5e), release, with a scratch settings folder (INCODE_DIR), so the real settings were not touched. The agent was Claude Code with the installed CLI; the only model calls were two one-word turns.

    Item Result
    Key bindings (keybindings.toml) Pass, with a control
    Status line Pass (renders, updates after a turn, a slow script keeps the last line)
    /cost Pass for what a CLI agent can show; the priced-model numbers are not checked
    Notifications Pass for notify = bell and notify_command; the Windows toast needs your eyes
    /compact Not testable here: no API key is set

    Key bindings

    keybindings.toml with "ctrl-l" = "clear-line". The input row of the box, frame by frame:

    • typed hello world: │ hello world
    • Ctrl-L: │ followed by blanks, so the line is empty
    • typed again afterwards: │ again, so the box still works.

    Control, with no keybindings.toml: Ctrl-L turns hello world into hello worldl.

    Small bug found: an unbound Ctrl or Alt letter is typed into the box as the plain letter. In Footer::on_key (src/cli/footer.rs), the KeyCode::Char(ch) arm inserts ch whatever the modifiers are. Only c d u k a e w are handled before it, so Ctrl-L, Ctrl-B, Ctrl-F and the Alt-letters all insert a letter. A binding (as above) fixes it per key. A fix would be to skip the insert when Ctrl or Alt is held and nothing handled the key. I did not touch the repo.

    Status line

    statusline_command is a .cmd script that prints SL-run-<n> on <cwd> and logs each run; it sleeps 5 s when a slow.flag file exists.

    • At start, the box's top rule: ╭─ SL-run-1 on D:\...\conpty\ws ───…╮ (the script log says run 1 fast)
    • After turn 1: ╭─ SL-run-2 on D:\...\conpty\ws ───…╮ (log run 2 fast), so it re-runs after a turn.
    • With slow.flag set, after turn 2: the rule still reads SL-run-2. The log has run 3 SLOW, so the script did run, was given up on at 1.5 s, and the last good line stayed.

    /cost

    • Before any turn: --- Cost --- / No tokens reported yet this session.

    • After one turn on the Claude Code agent:

      • claude-code: unpriced
      • input 2 output 7 cache write 20168 cache read 0
      • Total: ~$0.0000 (1 model(s) unpriced, not included)
      • Estimate from list prices (src/runtime/usage.rs PRICES); a subscription is billed differently.

      So an unpriced model says so and is never guessed. The numbers for a priced API model are not checked (that needs an API key).

    Notifications

    Settings: "notify": "bell", "notify_after_secs": 1, and a notify_command that appends %INCODE_EVENT% / %INCODE_MESSAGE% to a file. After each of the two turns (about 6 s each):

    • the file gained one line, done / Turn finished after 6s: two lines in total, matching the two turns;
    • the console output carried one BEL (\x07) per turn: 1 after turn 1, 2 after turn 2.

    /cost and the status line ran between the turns and added nothing, so only turns trigger it. Still for the owner: seeing the visible Windows toast (notify = desktop), and the "agent stops to ask for permission" case.

    /compact

    No API key is set anywhere on this machine: ANTHROPIC_API_KEY, ZAI_API_KEY, OPENROUTER_API_KEY and INCORD_KEY (the names in api_models) are all unset in the process and user environment. On the Claude Code agent /compact answers "The agent manages its own context and compacts it automatically. Use /clear to start a fresh session." That is the designed CLI-agent path, not the API route this item is about. It needs an API key.

    Still for the owner: the toast, /compact on the API route (with a key), MCP OAuth login, and the first-use .mcp.json approval prompt in the terminal.

  6. blockmandev commented on Nov 13, 2026

    @blockmandev
    MemberAuthor

    incode mcp login against a real OAuth server: passed on Windows (installed incode 0.1.0)

    Server: GitHub's remote MCP server (https://api.githubcopilot.com/mcp/) in a project .mcp.json, using a hand-registered GitHub OAuth app (GitHub offers no dynamic client registration), with oauth.callback_port 33418.

    1. incode mcp login github-oauth-test: the browser opened GitHub's Authorize page (PKCE S256, resource set, the server's advertised scopes). After Authorize, the loopback callback was received and the command printed logged in. Exit 0.
    2. incode mcp list: OAuth: logged in. After incode mcp approve, it showed approved.
    3. Used a tool: incode -t called mcp__github-oauth-test__get_me, and GitHub returned the signed-in account. In -p read-only the same call is refused, as expected.
    4. incode mcp logout github-oauth-test: its tokens are forgotten. incode mcp list then shows not logged in.

    Not run: macOS open. Item 19 is still unticked because approval went through incode mcp approve, not the first-use prompt in the REPL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions