mirror of
https://github.com/agentclientprotocol/claude-agent-acp.git
synced 2026-11-12 20:31:15 +00:00
Compare commits
2 Commits
v0.85.2-pr
...
v0.86.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7b5c61a4ed | ||
|
|
5598efbc8a |
@@ -1,3 +1,3 @@
|
||||
{
|
||||
".": "0.85.1"
|
||||
".": "0.86.0"
|
||||
}
|
||||
|
||||
21
CHANGELOG.md
21
CHANGELOG.md
@@ -1,5 +1,26 @@
|
||||
# Changelog
|
||||
|
||||
## [0.86.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.85.1...v0.86.0) (2026-10-05)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* answer /mcp in chat with the MCP server status and a reconnect ([#1218](https://github.com/agentclientprotocol/claude-agent-acp/issues/1218)) ([190a00f](https://github.com/agentclientprotocol/claude-agent-acp/commit/190a00f68f773315e93630464397944e645616ff))
|
||||
* **deps:** Bump @anthropic-ai/claude-agent-sdk to 0.3.287 ([#1224](https://github.com/agentclientprotocol/claude-agent-acp/issues/1224)) ([ddd5f54](https://github.com/agentclientprotocol/claude-agent-acp/commit/ddd5f541879118edb18df7ff09cd6682d455c710))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* count a subagent's permission requests as the turn waiting on the user ([#1241](https://github.com/agentclientprotocol/claude-agent-acp/issues/1241)) ([d599333](https://github.com/agentclientprotocol/claude-agent-acp/commit/d599333b722a951553c0efd40a76559b1f32e6ab))
|
||||
* drop queued prompts a cancel ends from Claude Code's queue ([#1228](https://github.com/agentclientprotocol/claude-agent-acp/issues/1228)) ([d83f28a](https://github.com/agentclientprotocol/claude-agent-acp/commit/d83f28a4035c5a5e54950fd58c7b73bfc2313664))
|
||||
* end a cancelled turn when the force-cancel fires during an update ([#1243](https://github.com/agentclientprotocol/claude-agent-acp/issues/1243)) ([a44c486](https://github.com/agentclientprotocol/claude-agent-acp/commit/a44c486019e98ad478c549c4902e7092f1418d0b))
|
||||
* end a closed session's turns before session/close answers ([#1242](https://github.com/agentclientprotocol/claude-agent-acp/issues/1242)) ([b1d6cfc](https://github.com/agentclientprotocol/claude-agent-acp/commit/b1d6cfc6c9fc9ec397e607b68ac100f4d48745b3))
|
||||
* end a held turn cancelled mid-followup at its interrupt's idle ([#1229](https://github.com/agentclientprotocol/claude-agent-acp/issues/1229)) ([d3e673b](https://github.com/agentclientprotocol/claude-agent-acp/commit/d3e673b263cf47603a35a50bb3da8b483199f690))
|
||||
* excessive message/token_count API calls when probing context window ([#1258](https://github.com/agentclientprotocol/claude-agent-acp/issues/1258)) ([5598efb](https://github.com/agentclientprotocol/claude-agent-acp/commit/5598efbc8ab16720ea79f5c97db40771ad0b317b))
|
||||
* replay a session with a Write on the experimental ACP v2 surface ([#1238](https://github.com/agentclientprotocol/claude-agent-acp/issues/1238)) ([22139f7](https://github.com/agentclientprotocol/claude-agent-acp/commit/22139f73c48e621752089a91fb095269493896b1))
|
||||
* report a command's exit code only when the tool result says it ([#1252](https://github.com/agentclientprotocol/claude-agent-acp/issues/1252)) ([52a92be](https://github.com/agentclientprotocol/claude-agent-acp/commit/52a92be959f7f8ea90ab08d54bae6900596ab435))
|
||||
* restore main-thread agent config option ([#1250](https://github.com/agentclientprotocol/claude-agent-acp/issues/1250)) ([8589a9c](https://github.com/agentclientprotocol/claude-agent-acp/commit/8589a9cf150d8deca6d2f8ef24404d927b3d4828))
|
||||
|
||||
## [0.85.1](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.85.0...v0.85.1) (2026-10-01)
|
||||
|
||||
|
||||
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@agentclientprotocol/claude-agent-acp",
|
||||
"version": "0.85.1",
|
||||
"version": "0.86.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@agentclientprotocol/claude-agent-acp",
|
||||
"version": "0.85.1",
|
||||
"version": "0.86.0",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@agentclientprotocol/sdk": "1.7.0",
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"version": "0.85.1",
|
||||
"version": "0.86.0",
|
||||
"description": "An ACP-compatible coding agent powered by the Claude Agent SDK (TypeScript)",
|
||||
"main": "dist/lib.js",
|
||||
"types": "dist/lib.d.ts",
|
||||
|
||||
@@ -8677,15 +8677,21 @@ export class ClaudeAcpAgent {
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace a heuristic context window with `getContextUsage().rawMaxTokens`
|
||||
* Refine a heuristic context window with `getContextUsage().rawMaxTokens`,
|
||||
* without blocking the caller. The text heuristic misses natively-1M models
|
||||
* whose picker rows carry no "1m" token (`sonnet`, and since CLI 2.1.283
|
||||
* `opus`/`default`), which would otherwise report 200k until the first
|
||||
* result's modelUsage. Never awaited: SDK control requests are serialized,
|
||||
* so an awaited call would delay session/new or a model switch (before the
|
||||
* first turn it took ~15s on older CLIs, issues #886/#880; ~0.5s on 2.1.283).
|
||||
* Not written to `contextWindowCache` — that stays keyed to the
|
||||
* `result.modelUsage` spellings — and a result still overwrites it.
|
||||
* whose picker rows carry no "1m" token (e.g. `sonnet`, and since CLI
|
||||
* 2.1.283 `opus`/`default`), so those would otherwise show 200k until the
|
||||
* first result's modelUsage arrives.
|
||||
*
|
||||
* Never awaited: SDK control requests are serialized, so awaiting here
|
||||
* would delay session/new or a model switch (~15s on older CLIs, issues
|
||||
* #886/#880; ~0.5s on 2.1.283). Requests the `summary` detail instead of
|
||||
* the default `full` breakdown, which issues one `messages/count_tokens`
|
||||
* call per category (~18 for a bare session) and hit rate limits on every
|
||||
* model switch; `summary` answers locally with the same `rawMaxTokens`.
|
||||
*
|
||||
* Does not write `contextWindowCache` (that stays keyed to the
|
||||
* `result.modelUsage` spellings) — a later result still overwrites this.
|
||||
*/
|
||||
private refreshContextWindowInBackground(sessionId: string, session: Session): void {
|
||||
if (session.contextWindowAuthoritative) return;
|
||||
@@ -8697,7 +8703,7 @@ export class ClaudeAcpAgent {
|
||||
session.models.currentModelId === modelId;
|
||||
// A synchronous throw must not fail the caller either.
|
||||
Promise.resolve()
|
||||
.then(() => query.getContextUsage())
|
||||
.then(() => query.getContextUsage({ detail: "summary" }))
|
||||
.then(
|
||||
(usage) => {
|
||||
if (!stillCurrent() || session.contextWindowAuthoritative) return;
|
||||
|
||||
@@ -14,6 +14,7 @@ import * as path from "node:path";
|
||||
|
||||
let capturedOptions: Options | undefined;
|
||||
let contextUsageResult: (() => Promise<{ rawMaxTokens: number; model?: string }>) | undefined;
|
||||
let contextUsageCalls: Array<{ detail?: "summary" | "full" } | undefined> = [];
|
||||
let sessionMessages: Record<string, unknown>[];
|
||||
let sessionMessagesResult: () => Promise<Record<string, unknown>[]>;
|
||||
let initModels: Record<string, unknown>[] | undefined;
|
||||
@@ -47,8 +48,10 @@ vi.mock("@anthropic-ai/claude-agent-sdk", async () => {
|
||||
return initializationResponse();
|
||||
},
|
||||
setModel: (model: string) => (setModelImpl ? setModelImpl(model) : Promise.resolve()),
|
||||
getContextUsage: () =>
|
||||
contextUsageResult ? contextUsageResult() : Promise.resolve(DEFAULT_CONTEXT_USAGE),
|
||||
getContextUsage: (opts?: { detail?: "summary" | "full" }) => {
|
||||
contextUsageCalls.push(opts);
|
||||
return contextUsageResult ? contextUsageResult() : Promise.resolve(DEFAULT_CONTEXT_USAGE);
|
||||
},
|
||||
mcpServerStatus: () => mcpServerStatusResult(),
|
||||
mcpAuthenticate: (serverName: string) => mcpAuthenticateImpl(serverName),
|
||||
});
|
||||
@@ -94,6 +97,7 @@ describe("createSession options merging", () => {
|
||||
beforeEach(async () => {
|
||||
capturedOptions = undefined;
|
||||
contextUsageResult = undefined;
|
||||
contextUsageCalls = [];
|
||||
sessionMessages = [];
|
||||
sessionMessagesResult = async () => sessionMessages;
|
||||
vi.mocked(getSessionMessages).mockClear();
|
||||
@@ -910,6 +914,15 @@ describe("createSession options merging", () => {
|
||||
expect(sessionFor(response.sessionId).contextWindowAuthoritative).toBe(true);
|
||||
});
|
||||
|
||||
it("asks for the summary context usage so the CLI sends no count_tokens requests", async () => {
|
||||
// The default `full` detail counts each context category with its own
|
||||
// messages/count_tokens request — a burst that hit rate limits on every
|
||||
// model switch — while only `rawMaxTokens` is needed here.
|
||||
await agent.newSession({ cwd: process.cwd(), mcpServers: [] });
|
||||
|
||||
await vi.waitFor(() => expect(contextUsageCalls).toEqual([{ detail: "summary" }]));
|
||||
});
|
||||
|
||||
it("keeps the guessed window when getContextUsage reports a non-positive size", async () => {
|
||||
const ctxSpy = vi.fn(async () => ({ rawMaxTokens: 0 }));
|
||||
contextUsageResult = ctxSpy;
|
||||
|
||||
@@ -1192,6 +1192,7 @@ describe("session config options", () => {
|
||||
|
||||
// The switch resolved without waiting for getContextUsage.
|
||||
expect(session.query.getContextUsage).toHaveBeenCalledOnce();
|
||||
expect(session.query.getContextUsage).toHaveBeenCalledWith({ detail: "summary" });
|
||||
expect(session.contextWindowSize).toBe(200000);
|
||||
|
||||
answer({ rawMaxTokens: 967000 });
|
||||
|
||||
Reference in New Issue
Block a user