Repository navigation
VS Code extension, Python and TypeScript SDKs, local test runner, and fixes from the first real CI run - #16
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
VS Code extension (
editors/vscode/)incode --acp: a protocol client with no VS Code dependency, plus a chat view.createElement/textContentonly, and only http(s) links.WorkspaceEdit, so edits are undoable, and are limited to the workspace.SDKs (
sdk/)incode_sdk(stdlib only, 3.9+) and TypeScript@incord/incode-sdk(Node 18+, no runtime deps).run_task/runTaskdrivesincode -t --output-format json.Sessiondrivesincode --acp: typed event stream, permission and fs callbacks (workspace-only by default), cancel.Local testing
scripts/test-all.shruns everything CI does plus the SDK and extension suites, skipping what the machine lacks.TESTING.mdcovers every suite, the Windows report script, the#[ignore]d live tests and the variables that enable them, and what to try by hand.incode fixes found while building these
-pwith-twas parsed and dropped. It's now applied to every candidate agent and its sandbox, soincode reviewruns read-only.-t --output-format jsonrun that fails before starting now prints a JSON result object instead of nothing.run_task_astakes its optional parts asRunOptions.Fixes from the first real CI run on Linux, Windows and macOS
@C:\…\fileincludes were left as text instead of refused as outside the workspace.\and a leading drive are now read as part of the path.--no-sandbox. The test skips on that machine state..gitprotection is a refusal there (Seatbelt), not an undo; the test accepts that.Test plan
scripts/test-all.sh, all parts:clippy -D warnings,cargo test --lib(2,102),--bins(52),--test sbx_engine,-p incord-sandbox;INCODE_BIN=target/debug/incode): Python OK, TypeScript 38/38, extension 55/55cargo check --target x86_64-pc-windows-gnu --all-targetsnpm run package, then install the.vsix)Generated by Claude Code