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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Repo: https://github.com/openclaw/acpx

- Sessions/load: fall back to a fresh ACP session when adapters reject `session/load` with JSON-RPC `-32601` or `-32602`, so persistent session reconnects do not crash on partial load support. (#174) Thanks @Bortlesboat.
- Flows/runtime: finalize interrupted `flow run` bundles as failed instead of leaving them stuck at `running` when the process receives `SIGHUP`, `SIGINT`, or `SIGTERM`.
- Client/auth: cache derived auth env key lists per auth method to avoid repeated allocations during credential lookup. (#167) Thanks @Yuan-ManX.

## 2026.3.12 (v0.3.0)

Expand Down
14 changes: 13 additions & 1 deletion src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ function toEnvToken(value: string): string {
.toUpperCase();
}

function authEnvKeys(methodId: string): string[] {
function buildAuthEnvKeys(methodId: string): string[] {
const token = toEnvToken(methodId);
const keys = new Set<string>([methodId]);
if (token) {
Expand All @@ -674,6 +674,18 @@ function authEnvKeys(methodId: string): string[] {
return [...keys];
}

const authEnvKeysCache = new Map<string, string[]>();

function authEnvKeys(methodId: string): string[] {
const cached = authEnvKeysCache.get(methodId);
if (cached) {
return cached;
}
const keys = buildAuthEnvKeys(methodId);
authEnvKeysCache.set(methodId, keys);
return keys;
}

function readEnvCredential(methodId: string): string | undefined {
for (const key of authEnvKeys(methodId)) {
const value = process.env[key];
Expand Down