@agentclientprotocol/codex-acp 0.0.42 → 0.0.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +17 -7
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -18958,7 +18958,7 @@ var package_default = {
18958
18958
  publishConfig: {
18959
18959
  access: "public"
18960
18960
  },
18961
- version: "0.0.42",
18961
+ version: "0.0.43",
18962
18962
  description: "",
18963
18963
  main: "dist/index.js",
18964
18964
  bin: {
@@ -19167,7 +19167,7 @@ var CodexAcpClient = class {
19167
19167
  cwd: request.cwd,
19168
19168
  developerInstructions: null,
19169
19169
  model: null,
19170
- modelProvider: this.getModelProvider(),
19170
+ modelProvider: this.getResumeModelProvider(),
19171
19171
  personality: null,
19172
19172
  threadId: request.sessionId
19173
19173
  });
@@ -19188,7 +19188,7 @@ var CodexAcpClient = class {
19188
19188
  cwd: request.cwd,
19189
19189
  developerInstructions: null,
19190
19190
  model: null,
19191
- modelProvider: this.getModelProvider(),
19191
+ modelProvider: this.getResumeModelProvider(),
19192
19192
  personality: null,
19193
19193
  threadId: request.sessionId
19194
19194
  });
@@ -19252,6 +19252,9 @@ var CodexAcpClient = class {
19252
19252
  getModelProvider() {
19253
19253
  return this.gatewayConfig?.modelProvider ?? this.modelProvider;
19254
19254
  }
19255
+ getResumeModelProvider() {
19256
+ return this.getModelProvider() ?? "openai";
19257
+ }
19255
19258
  async refreshSkills(cwd, meta) {
19256
19259
  if (!cwd) {
19257
19260
  return;
@@ -19937,7 +19940,7 @@ var CodexAcpServer = class {
19937
19940
  logger.log(`Create new session...`);
19938
19941
  sessionMetadata = await this.runWithProcessCheck(() => this.codexAcpClient.newSession(request));
19939
19942
  }
19940
- const accountResponse = await this.runWithProcessCheck(() => this.codexAcpClient.getAccount());
19943
+ const account = await this.getActiveAccount();
19941
19944
  const { sessionId, currentModelId, models } = sessionMetadata;
19942
19945
  const sessionMcpServers = this.resolveSessionMcpServers(requestedMcpServers, "sessionId" in request);
19943
19946
  const currentModel = this.findCurrentModel(models, currentModelId);
@@ -19952,7 +19955,7 @@ var CodexAcpServer = class {
19952
19955
  totalTokenUsage: null,
19953
19956
  modelContextWindow: null,
19954
19957
  rateLimits: null,
19955
- account: accountResponse.account,
19958
+ account,
19956
19959
  cwd: request.cwd,
19957
19960
  sessionMcpServers
19958
19961
  };
@@ -19969,6 +19972,13 @@ var CodexAcpServer = class {
19969
19972
  const sessionModeState = sessionState.agentMode.toSessionModeState();
19970
19973
  return [sessionId, sessionModelState, sessionModeState];
19971
19974
  }
19975
+ async getActiveAccount() {
19976
+ if (this.codexAcpClient.getModelProvider()) {
19977
+ return null;
19978
+ }
19979
+ const accountResponse = await this.runWithProcessCheck(() => this.codexAcpClient.getAccount());
19980
+ return accountResponse.account;
19981
+ }
19972
19982
  async loadSession(params) {
19973
19983
  logger.log("Loading session...", { sessionId: params.sessionId });
19974
19984
  const {
@@ -20108,7 +20118,7 @@ var CodexAcpServer = class {
20108
20118
  const sessionMetadata = await this.runWithProcessCheck(
20109
20119
  () => this.codexAcpClient.loadSession(request)
20110
20120
  );
20111
- const accountResponse = await this.runWithProcessCheck(() => this.codexAcpClient.getAccount());
20121
+ const account = await this.getActiveAccount();
20112
20122
  const { sessionId, currentModelId, models, thread } = sessionMetadata;
20113
20123
  const sessionMcpServers = this.resolveSessionMcpServers(requestedMcpServers, true);
20114
20124
  const currentModel = this.findCurrentModel(models, currentModelId);
@@ -20123,7 +20133,7 @@ var CodexAcpServer = class {
20123
20133
  totalTokenUsage: null,
20124
20134
  modelContextWindow: null,
20125
20135
  rateLimits: null,
20126
- account: accountResponse.account,
20136
+ account,
20127
20137
  cwd: request.cwd,
20128
20138
  sessionMcpServers
20129
20139
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.0.42",
6
+ "version": "0.0.43",
7
7
  "description": "",
8
8
  "main": "dist/index.js",
9
9
  "bin": {