perf(gateway): reuse prepared auth stores · openclaw/openclaw@d2711c9
steipete
·
2026-05-27
·
via Recent Commits to openclaw:main
File tree
extensions/codex/src/app-server
| Original file line number | Diff line number | Diff line change |
|---|
@@ -131,6 +131,16 @@ function resolveCodexAppServerAuthProfileStore(params: {
|
131 | 131 | authProfileStore?: AuthProfileStore; |
132 | 132 | config?: AuthProfileOrderConfig; |
133 | 133 | }): AuthProfileStore { |
| 134 | +if (params.authProfileStore) { |
| 135 | +const providedProfileId = resolveCodexAppServerAuthProfileId({ |
| 136 | +authProfileId: params.authProfileId, |
| 137 | +store: params.authProfileStore, |
| 138 | +config: params.config, |
| 139 | +}); |
| 140 | +if (providedProfileId && params.authProfileStore.profiles[providedProfileId]) { |
| 141 | +return params.authProfileStore; |
| 142 | +} |
| 143 | +} |
134 | 144 | const overlaidStore = ensureCodexAppServerAuthProfileStore({ |
135 | 145 | agentDir: params.agentDir, |
136 | 146 | authProfileId: params.authProfileId, |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -4315,9 +4315,14 @@ async function buildDynamicTools(input: DynamicToolBuildParams) {
|
4315 | 4315 | : undefined, |
4316 | 4316 | modelApi: params.model.api, |
4317 | 4317 | modelContextWindowTokens: params.model.contextWindow, |
4318 | | -modelAuthMode: resolveModelAuthMode(params.model.provider, params.config, undefined, { |
4319 | | -workspaceDir: input.effectiveWorkspace, |
4320 | | -}), |
| 4318 | +modelAuthMode: resolveModelAuthMode( |
| 4319 | +params.model.provider, |
| 4320 | +params.config, |
| 4321 | +params.toolAuthProfileStore ?? params.authProfileStore, |
| 4322 | +{ |
| 4323 | +workspaceDir: input.effectiveWorkspace, |
| 4324 | +}, |
| 4325 | +), |
4321 | 4326 | suppressManagedWebSearch: false, |
4322 | 4327 | currentChannelId: params.currentChannelId, |
4323 | 4328 | hookChannelId: resolveCodexAppServerHookChannelId(params, input.sandboxSessionKey), |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -136,6 +136,7 @@ function resolveProfileAuthFromStore(params: { agentDir: string; profileId: stri
|
136 | 136 | } |
137 | 137 | const credential = ensureAuthProfileStore(params.agentDir, { |
138 | 138 | allowKeychainPrompt: false, |
| 139 | +externalCliProfileIds: [profileId], |
139 | 140 | }).profiles[profileId]; |
140 | 141 | return { provider: credential?.provider, mode: credential?.type }; |
141 | 142 | } |
@@ -182,6 +183,7 @@ function resolveHarnessAuthProfileSelection(params: {
|
182 | 183 | |
183 | 184 | const store = ensureAuthProfileStore(params.agentDir, { |
184 | 185 | allowKeychainPrompt: false, |
| 186 | +externalCliProviderIds: [harnessAuthProvider], |
185 | 187 | }); |
186 | 188 | const authProfileId = resolveAuthProfileOrder({ |
187 | 189 | cfg: params.config, |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。