mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 07:20:43 +00:00
fix(agents): make originalProvider optional in runAgentAttempt params
The required-typed param introduced in 9987e7797f broke
attempt-execution.cli.test.ts and auth-profile-runtime-contract.test.ts
which construct runAgentAttempt params without an originalProvider field.
Make it optional and explicitly require the typeof check before passing
to isClaudeCliProvider so a missing field correctly skips the seed
(defensive default for fallback paths that didn't plumb the original
provider through, no-op for non-fallback paths).
This commit is contained in:
@@ -240,9 +240,13 @@ export function runAgentAttempt(params: {
|
||||
* fallback context seeding to chains that actually started on claude-cli;
|
||||
* a stale `cliSessionBindings["claude-cli"]` from an unrelated past run
|
||||
* must not contaminate fallbacks that started on another provider
|
||||
* (Codex review #72069 P1).
|
||||
* (Codex review #72069 P1). Optional for callers that don't drive
|
||||
* a fallback chain (tests, ad-hoc invocations); when omitted, the
|
||||
* claude-cli fallback seed is skipped — that's a no-op for non-fallback
|
||||
* paths and a defensive default for fallback paths that didn't plumb
|
||||
* the original provider through.
|
||||
*/
|
||||
originalProvider: string;
|
||||
originalProvider?: string;
|
||||
cfg: OpenClawConfig;
|
||||
sessionEntry: SessionEntry | undefined;
|
||||
sessionId: string;
|
||||
@@ -283,6 +287,7 @@ export function runAgentAttempt(params: {
|
||||
// must not bleed into this fallback chain.
|
||||
const claudeCliFallbackPrelude =
|
||||
params.isFallbackRetry &&
|
||||
typeof params.originalProvider === "string" &&
|
||||
isClaudeCliProvider(params.originalProvider) &&
|
||||
!isClaudeCliProvider(params.providerOverride)
|
||||
? buildClaudeCliFallbackContextPrelude({
|
||||
|
||||
Reference in New Issue
Block a user