Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ Pick a built-in coding agent with `--agent`:
| Agent | In its microVMs | Connect with | Tested with Chopin |
| --------------------------------------------------------------------------------------------------- | ---------------------------------------------- | ----------------- | ------------------ |
| [GitHub Copilot CLI](https://docs.github.com/en/copilot/reference/copilot-cli-reference/acp-server) | `@github/copilot@1.0.114` | `--agent copilot` | Yes |
| [Atomic](https://github.com/bastani-inc/atomic-acp) | `atomic@0.10.23`, `@bastani/atomic-acp@0.0.21` | `--agent atomic` | Yes |
| [Atomic](https://github.com/bastani-inc/atomic-acp) | `atomic@0.10.24`, `@bastani/atomic-acp@0.0.22` | `--agent atomic` | Yes |

For any other agent that supports the Agent Client Protocol (ACP), pass its command after `--`, such as `chopin connect -- my-agent --acp`. If you also use Atomic directly on your own machine, install it with Atomic's standalone installer (`curl -fsSL https://raw.githubusercontent.com/bastani-inc/atomic/main/install.sh | sh`, or `install.ps1` on Windows) and keep it up to date with `atomic update`.

Expand Down
4 changes: 2 additions & 2 deletions apps/connector/src/images.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -581,11 +581,11 @@ describe("builtInRecipe and buildScript for curl-installed Atomic", () => {
expect(recipe).toBeDefined();
expect(recipe!.programs).toEqual(["atomic-acp", "atomic"]);
expect(recipe!.install[0]).toContain("bastani-inc/atomic/main/install.sh");
expect(recipe!.install[0]).toContain("--ref 0.10.23");
expect(recipe!.install[0]).toContain("--ref 0.10.24");
expect(recipe!.install[1]).toBe(
'ln -sfn ../atomic/current/atomic "$npm_config_prefix/bin/atomic"',
);
expect(recipe!.install[2]).toBe("npm install -g @bastani/atomic-acp@0.0.21");
expect(recipe!.install[2]).toBe("npm install -g @bastani/atomic-acp@0.0.22");
let script = buildScript(recipe!, USER, LAYER);
expect(script).toContain('CURL_CA_BUNDLE="$A/ca-certificates.crt"');
});
Expand Down
8 changes: 4 additions & 4 deletions apps/connector/src/machine-store.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function installing(version: string): AdapterInstaller {
}

const fakeInstall: AdapterInstaller = async root => {
await installing("0.10.23")(root);
await installing("0.10.24")(root);
mkdirSync(join(root, "node_modules", "pg"), { recursive: true });
writeFileSync(join(root, "node_modules", "pg", "package.json"), "{}");
};
Expand Down Expand Up @@ -160,14 +160,14 @@ describe("a machine's database login on the connector", () => {
throw new Error("npm install failed: network");
})).rejects.toThrow("network");
expect(version()).toBe("0.10.21");
expect(await storeAdapter(directory, installing("0.10.23"))).toBe(root);
expect(version()).toBe("0.10.23");
expect(await storeAdapter(directory, installing("0.10.24"))).toBe(root);
expect(version()).toBe("0.10.24");
expect(existsSync(join(root, "stale.txt"))).toBe(false);
let installs = 0;
expect(
await storeAdapter(directory, async staging => {
installs++;
await installing("0.10.23")(staging);
await installing("0.10.24")(staging);
}),
).toBe(root);
expect(installs).toBe(0);
Expand Down
2 changes: 1 addition & 1 deletion apps/connector/src/machine-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import type { Output } from "./output";
import { readOwn, realDirectory, writeOwn } from "./ai-agent";

/** The adapter releases agents here are given, as the Atomic they run. */
export const STORE_ADAPTER_RANGE = "^0.10.23";
export const STORE_ADAPTER_RANGE = "^0.10.24";
export const STORE_ADAPTER_SPEC = `${MACHINE_STORE_ADAPTER}@${STORE_ADAPTER_RANGE}`;
export const STORE_MAX_CONNECTIONS = 4;
export const UNUSABLE_SAVED_STORE =
Expand Down
2 changes: 1 addition & 1 deletion apps/connector/src/machine.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ async function installedAdapter(home: string) {
"atomic-storage-postgres",
);
await mkdir(adapter, { recursive: true });
await writeFile(join(adapter, "package.json"), JSON.stringify({ version: "0.10.23" }));
await writeFile(join(adapter, "package.json"), JSON.stringify({ version: "0.10.24" }));
}

test("pairing sets up the machine's database login in the same step, readable only by its owner", async () => {
Expand Down
2 changes: 1 addition & 1 deletion apps/connector/src/planner-disks.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ async function fakeAgentStore(directory: string) {
let adapter = await storeAdapter(directory, async root => {
let dir = join(root, "node_modules", ...MACHINE_STORE_ADAPTER.split("/"));
mkdirSync(dir, { recursive: true });
writeFileSync(join(dir, "package.json"), JSON.stringify({ version: "0.10.23" }));
writeFileSync(join(dir, "package.json"), JSON.stringify({ version: "0.10.24" }));
});
return new AgentStore(STORE_LOGIN, adapter);
}
Expand Down
8 changes: 8 additions & 0 deletions apps/server/src/ai/subscriptions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,14 @@ describe("Sign in with ChatGPT", () => {
"http://127.0.0.1:1455/auth/callback?code=c&state=another&client_id=app",
"This address is from another sign-in. Paste the one from the sign-in you just opened.",
],
[
"http://127.0.0.1:1455/auth/callback?error=access_denied&state=another",
"This address is from another sign-in. Paste the one from the sign-in you just opened.",
],
[
"http://127.0.0.1:1455/auth/callback?error=access_denied",
"This address is from another sign-in. Paste the one from the sign-in you just opened.",
],
[
`http://127.0.0.1:1455/auth/callback?code=c&state=${state}`,
"This address has no client ID from ChatGPT. Start again.",
Expand Down
16 changes: 8 additions & 8 deletions apps/server/src/ai/subscriptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ export function beginSignIn(
/**
* What the person pasted, read as the provider's answer to `pending` before anything is sent: for
* ChatGPT the callback address, whose origin and path must be the redirect's, with the same state
* and an issued client id; for Claude the code, `code#state` or an address carrying them, whose
* state, if any, must be the sign-in's.
* (checked before any error it carries, as Atomic does) and an issued client id; for Claude the
* code, `code#state` or an address carrying them, whose state, if any, must be the sign-in's.
*/
export function pastedAnswer(
pending: PendingSignIn,
Expand All @@ -173,6 +173,12 @@ export function pastedAnswer(
if (url.origin !== expected.origin || url.pathname !== expected.pathname) {
throw new SignInFailed(`The address you paste starts with ${CHATGPT.redirect}.`);
}
let state = url.searchParams.get("state");
if (!state || state !== pending.state) {
throw new SignInFailed(
"This address is from another sign-in. Paste the one from the sign-in you just opened.",
);
}
let error = url.searchParams.get("error");
if (error) {
throw new SignInFailed(
Expand All @@ -183,12 +189,6 @@ export function pastedAnswer(
}
let code = url.searchParams.get("code");
if (!code) throw new SignInFailed("This address has no sign-in code. Paste the whole address.");
let state = url.searchParams.get("state");
if (!state || state !== pending.state) {
throw new SignInFailed(
"This address is from another sign-in. Paste the one from the sign-in you just opened.",
);
}
let clientId = url.searchParams.get("client_id")?.trim();
if (!clientId) {
throw new SignInFailed("This address has no client ID from ChatGPT. Start again.");
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/harness/atomic.contract.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ describe("atomic worker host isolation and model resolution", () => {

it("refuses non-gateway models under the ai-gateway auth mode", async () => {
stub.requests.length = 0;
await expect(run("plain", { model: "anthropic/claude-sonnet-4-5" })).rejects.toThrow(
await expect(run("plain", { model: "anthropic/claude-sonnet-4-6" })).rejects.toThrow(
"HARNESS_AUTH ai-gateway allows only vercel-ai-gateway models",
);
expect(stub.requests).toHaveLength(0);
Expand Down
Loading
Loading