Skip to content

VS Code extension, Python and TypeScript SDKs, local test runner, and fixes from the first real CI run - #16

Merged
blockmandev merged 11 commits into
mainfrom
claude/laughing-darwin-hyqkjj
Oct 20, 2026
Merged

blockmandev merged 11 commits into
mainfrom
claude/laughing-darwin-hyqkjj

Conversation

@blockmandev

Copy link
Copy Markdown
Member

Summary

VS Code extension (editors/vscode/)

  • Drives incode --acp: a protocol client with no VS Code dependency, plus a chat view.
    • The chat view streams the agent's text and shows tool calls, plan and usage.
    • It also has permission buttons, mode/role/agent pickers, Stop, and slash-command completion.
  • Model output is untrusted: a strict CSP, rendered with createElement/textContent only, and only http(s) links.
  • File requests go through WorkspaceEdit, so edits are undoable, and are limited to the workspace.
  • Commands: open chat, new session, send selection, restart.

SDKs (sdk/)

  • Python incode_sdk (stdlib only, 3.9+) and TypeScript @incord/incode-sdk (Node 18+, no runtime deps).
    • run_task/runTask drives incode -t --output-format json.
    • Session drives incode --acp: typed event stream, permission and fs callbacks (workspace-only by default), cancel.
  • Testing: a shared fake incode, and examples for each SDK.

Local testing

  • scripts/test-all.sh runs everything CI does plus the SDK and extension suites, skipping what the machine lacks.
  • TESTING.md covers every suite, the Windows report script, the #[ignore]d live tests and the variables that enable them, and what to try by hand.
  • CI gets a job for the SDKs and the extension.

incode fixes found while building these

  • -p with -t was parsed and dropped. It's now applied to every candidate agent and its sandbox, so incode review runs read-only.
  • A -t --output-format json run that fails before starting now prints a JSON result object instead of nothing.
  • run_task_as takes its optional parts as RunOptions.
  • The ACP module docs now match the capabilities advertised (images, HTTP MCP servers).

Fixes from the first real CI run on Linux, Windows and macOS

  • Windows: @C:\…\file includes were left as text instead of refused as outside the workspace. \ and a leading drive are now read as part of the path.
  • Linux: RenderPdf with a browser that can't build its own sandbox (setuid helper not root's; Ubuntu 23.10+ without user namespaces) now says so and what to do. incode still never passes --no-sandbox. The test skips on that machine state.
  • Windows: the UIA live test now checks that each element's rectangle overlaps the desktop, not that its centre is on it. Windows wider than the runner's screen tripped the old check.
  • macOS: sbx .git protection is a refusal there (Seatbelt), not an undo; the test accepts that.

Test plan

  • scripts/test-all.sh, all parts:
    • fmt, clippy -D warnings, cargo test --lib (2,102), --bins (52), --test sbx_engine, -p incord-sandbox;
    • Python SDK 36 (1 live test skipped), TypeScript SDK 37, extension 54.
  • Live against the real binary (INCODE_BIN=target/debug/incode): Python OK, TypeScript 38/38, extension 55/55
  • cargo check --target x86_64-pc-windows-gnu --all-targets
  • CI on this PR: the first green run on Windows and macOS would confirm the fixes above
  • The extension in a real VS Code (npm run package, then install the .vsix)

Generated by Claude Code

claude added 11 commits October 20, 2026 19:16
One script runs what CI runs (fmt, clippy, the library, binary and sbx
engine tests, the sandbox crate) plus the SDK and editor-extension suites
when their toolchains are present, skipping and naming what it cannot run.
TESTING.md lists each part, the Windows report script, the #[ignore]d live
tests and the variables that enable them, and what to try by hand.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011DiH8n52ifWoCd5Kx2aHwT
A chat view (webview, strict CSP, model text rendered through text nodes
only) with streamed text, tool calls, plan, permission buttons, mode and
config pickers, slash-command completion, Stop and usage. fs/read_text_file
returns open editor buffers; fs/write_text_file is an undoable
WorkspaceEdit; both are limited to the workspace folders (symlinks
resolved). The protocol client (src/acp.ts) has no vscode dependency and is
tested with node:test against a fake agent, plus an optional test against
the real binary (INCODE_BIN).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011DiH8n52ifWoCd5Kx2aHwT
Two ways to drive incode from a program, in both languages:

- one-shot: run_task()/runTask() wrap `incode -t ... --output-format json`
  and parse the result object (result, error, usage, cost_usd, exit code,
  stderr); TaskFailed carries the parsed result.
- interactive: Session speaks ACP to `incode --acp` (initialize,
  session/new|load, prompt streaming typed events, cancel, set_mode,
  set_config_option), answers session/request_permission (default: reject)
  and fs/read_text_file / fs/write_text_file (default: workspace only, after
  resolving symlinks and ..), skips malformed lines, and reports a crashed
  agent with its exit code and stderr.

Python (sdk/python, incode_sdk): stdlib only, 3.9+, threads, with a thin
asyncio wrapper. TypeScript (sdk/typescript, @incord/incode-sdk): Node 18+,
no runtime deps, strict, ESM + d.ts.

Both test suites run against sdk/testing/fake_incode.py, a scripted fake of
both modes; a live test runs initialize + session/new against INCODE_BIN.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011DiH8n52ifWoCd5Kx2aHwT
Found while building the SDKs:

- `-p` with `-t` was parsed and then dropped. It now rides the task and is
  applied to every candidate agent (the agent's own mode on a CLI route,
  the toolbox's on the API route, and the sandbox policy). Unset, the run
  keeps its default. `incode review` uses it: a review is now read-only.
- `-t --output-format json|stream-json` that failed before the run began
  (a bad -w, -p or --spec-gate) printed nothing on stdout. It now prints
  the one result object a script reads: {"type":"result","is_error":true,
  "error":...}.
- run_task_as takes its optional parts as RunOptions.
- The ACP module docs said text-only prompts and stdio-only client MCP
  servers; incode advertises images and HTTP servers too.
- CI runs the Python and TypeScript SDK and VS Code extension suites.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011DiH8n52ifWoCd5Kx2aHwT
- Windows: an `@C:\...\file` include was not read as one (the scanner
  stopped at the drive's `:` and knew only `/`), so it stayed text instead
  of being refused as outside the workspace. `\` now separates, and a
  leading drive is part of the path; a `:` elsewhere still ends it.
- Linux: RenderPdf through a browser that cannot build its own sandbox
  (the runner's Edge, whose setuid helper is not root's; Ubuntu 23.10+
  without unprivileged user namespaces) now says so and what to do.
  incode still never passes --no-sandbox. The test skips on that machine
  state, as it does when there is no browser.
- Windows: the UI Automation live test checked each element's centre lay
  on the desktop; a window wider than the runner's screen has buttons only
  partly on it. It now checks the rectangle overlaps the desktop, which
  proves the same thing (physical pixels).
- macOS: sbx's .git protection is a refusal there (the Seatbelt profile
  denies the writes), not an undo; the test accepts that.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011DiH8n52ifWoCd5Kx2aHwT
The first fix checked each element's rectangle overlapped the desktop; the
runner's 1024-pixel screen has a window whose caption glyph sits wholly past
the edge (x 1026), which UI Automation still reports. The test now checks
every element is within a desktop's size of it (screen pixels, not garbage)
and at least one is on it (the window is in the mouse's space).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011DiH8n52ifWoCd5Kx2aHwT
Windows CI hung 35 minutes in cargo test --lib: brief's served-brief test
joins its one-shot server while holding ENV_LOCK, and when the request never
came accept() waited for ever, so every env test queued behind it. Both
fake servers in brief.rs now accept within 30 seconds or end, which turns
that into a failure that says what check() returned. CI's test jobs time
out at 45 minutes instead of GitHub's six hours.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011DiH8n52ifWoCd5Kx2aHwT
runner.rs's a_repo() hands back the temp dir as `_guard`, which locks
nothing, so five runner tests and one in parallel.rs set and removed
INCODE_LANES concurrently. On Windows CI a_single_lane_never_creates_a_
worktree removed it mid-way through what_a_lane_spends_is_charged_to_the_
run, which then ran sequentially and failed. They now hold the env lock
the other env tests share.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011DiH8n52ifWoCd5Kx2aHwT
Windows runners check files out with CRLF, so splitting the module source
on "//! ```toml\n" found no example. It splits on the fence alone;
lines() already takes either ending. Checked with the file converted to
CRLF.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011DiH8n52ifWoCd5Kx2aHwT
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