Skip to content

Conversation

@jonathanlab
Copy link
Contributor

@jonathanlab jonathanlab commented Dec 1, 2025

Copy link
Contributor Author

jonathanlab commented Dec 1, 2025

This was referenced Dec 1, 2025
@jonathanlab jonathanlab marked this pull request as ready for review December 1, 2025 17:52
@jonathanlab jonathanlab requested a review from a team as a code owner December 1, 2025 17:52
Copy link
Contributor

@joshsny joshsny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good - left some comments :)

this.clientCapabilities = request.clientCapabilities;

// Default authMethod
const authMethod: any = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probs should change this?


const options: Options = {
systemPrompt,
settingSources: ["user", "project", "local"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how will this behave if the user has claude code installed locally and has settings there, how do we want it to behave?

Should we inherit their settings, or set this to local and make sure we control the settings in Array?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should inherit user settings.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am presuming most of this is copied from zed's existing adapter?

The code is not great, but if we're copying it over let's not change it as we know it works reasonably well.

Can we leave a comment saying where the code came from if that's the case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will add this.

},
agentInfo: {
name: packageJson.name,
title: "Claude Code",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we give it a different name?

}

async authenticate(_params: AuthenticateRequest): Promise<void> {
throw new Error("Method not implemented.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? Is this because we are passing the API key and we don't want to allow the user to do their own authentication?

}

async prompt(params: PromptRequest): Promise<PromptResponse> {
if (!this.sessions[params.sessionId]) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this work with handing off cloud -> local - I guess we can hydrate the session locally in that case

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we'll call loadSession first usually, this is just a safety check

}

async function getAvailableModels(query: Query): Promise<SessionModelState> {
const models = await query.supportedModels();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know what request this makes? We'll need to support it in the llm gateway

},
};
break;
case "thinking":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we get loading states via this? would be nice to get those messages claude code gives

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For sure, will add it to the list.

}
}

export function runAcp() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know what this does?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this sets up the communication stream between the ACP agent and the ACP client, and is used to kick off the agent connection

completed: validatedData.metadata?.completed ?? 0,
});

await this.writeTaskFile(taskId, {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

out of scope of these PRs, but I think this and any other changes that aren't code related should be persisted in S3 and not locally for resumability and handoff

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we'll start persisting these by reading the agent plan notifications from the S3 logs instead. https://agentclientprotocol.com/protocol/agent-plan

@jonathanlab jonathanlab force-pushed the 12-01-feat_set_up_acp_and_claude_adapter branch from 9063af6 to b72851b Compare December 2, 2025 13:36
Copy link
Contributor Author

jonathanlab commented Dec 2, 2025

Merge activity

  • Dec 2, 4:14 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Dec 2, 4:15 PM UTC: @jonathanlab merged this pull request with Graphite.

@jonathanlab jonathanlab merged commit 5411e0f into main Dec 2, 2025
8 of 11 checks passed
@jonathanlab jonathanlab deleted the 12-01-feat_set_up_acp_and_claude_adapter branch December 2, 2025 16:15
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.

3 participants