mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
fix(agents): prevent embedded runtime shadowing
This commit is contained in:
@@ -233,6 +233,12 @@
|
||||
"typescript/unbound-method": "off",
|
||||
"eslint/no-unsafe-optional-chaining": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": ["src/agents/embedded-agent-runner/run/attempt.ts"],
|
||||
"rules": {
|
||||
"eslint/no-shadow": "error"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1422,7 +1422,7 @@ export async function runEmbeddedAttempt(
|
||||
cfg: params.config,
|
||||
})
|
||||
: undefined;
|
||||
const bundleMcpRuntime = bundleMcpSessionRuntime
|
||||
bundleMcpRuntime = bundleMcpSessionRuntime
|
||||
? await materializeBundleMcpToolsForRun({
|
||||
runtime: bundleMcpSessionRuntime,
|
||||
reservedToolNames: [
|
||||
@@ -1436,7 +1436,7 @@ export async function runEmbeddedAttempt(
|
||||
disableTools: params.disableTools || isRawModelRun,
|
||||
toolsAllow: params.toolsAllow,
|
||||
});
|
||||
const bundleLspRuntime = bundleLspEnabled
|
||||
bundleLspRuntime = bundleLspEnabled
|
||||
? await createBundleLspToolRuntime({
|
||||
workspaceDir: effectiveWorkspace,
|
||||
cfg: params.config,
|
||||
@@ -2953,13 +2953,6 @@ export async function runEmbeddedAttempt(
|
||||
}
|
||||
|
||||
let yieldAborted = false;
|
||||
const getAbortReason = (signal: AbortSignal): unknown =>
|
||||
"reason" in signal ? (signal as { reason?: unknown }).reason : undefined;
|
||||
const makeTimeoutAbortReason = (): Error => {
|
||||
const err = new Error("request timed out");
|
||||
err.name = "TimeoutError";
|
||||
return err;
|
||||
};
|
||||
const abortCompaction = () => {
|
||||
if (!activeSession.isCompacting) {
|
||||
return;
|
||||
@@ -3190,7 +3183,6 @@ export async function runEmbeddedAttempt(
|
||||
|
||||
let abortWarnTimer: NodeJS.Timeout | undefined;
|
||||
const isProbeSession = params.sessionId?.startsWith("probe-") ?? false;
|
||||
const compactionTimeoutMs = resolveCompactionTimeoutMs(params.config);
|
||||
let abortTimer: NodeJS.Timeout | undefined;
|
||||
let compactionGraceUsed = false;
|
||||
const scheduleAbortTimer = (delayMs: number, reason: "initial" | "compaction-grace") => {
|
||||
|
||||
@@ -179,6 +179,12 @@ describe("oxlint config", () => {
|
||||
"eslint/no-unsafe-optional-chaining": "off",
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ["src/agents/embedded-agent-runner/run/attempt.ts"],
|
||||
rules: {
|
||||
"eslint/no-shadow": "error",
|
||||
},
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user