← Back to PRs

#23680: fix(types): add missing config and agentDir params to maybeMarkAuthProfileFailure

by NewdlDewdl open 2026-02-22 15:48 View on GitHub →
agents size: XS
## Problem The `maybeMarkAuthProfileFailure` function in `src/agents/pi-embedded-runner/run.ts` was accessing `params.config` and `params.agentDir` but these properties were not declared in the parameter type definition. This caused TypeScript compilation errors during the plugin SDK build step: ``` src/agents/pi-embedded-runner/run.ts(515,23): error TS2339: Property 'config' does not exist on type '{ profileId?: string | undefined; reason?: AuthProfileFailureReason | null | undefined; }'. src/agents/pi-embedded-runner/run.ts(516,28): error TS2339: Property 'agentDir' does not exist on type '{ profileId?: string | undefined; reason?: AuthProfileFailureReason | null | undefined; }'. ``` ## Solution 1. Added `import type { OpenClawConfig } from "../../config/types.openclaw.js"` to import the required type 2. Extended the parameter type for `maybeMarkAuthProfileFailure` to include: - `config?: OpenClawConfig` - `agentDir?: string` These properties match the types expected by the `markAuthProfileFailure` function that is called within the handler, and are already present in the outer `RunEmbeddedPiAgentParams` type. ## Testing - ✅ TypeScript compilation passes (`pnpm build`) - ✅ Type checking passes (`pnpm tsgo`) - ✅ Linting passes (`pnpm lint`) - ✅ Full test suite passes (`pnpm test`) --- *This PR was created with AI assistance as part of the OpenClaw autonomous contributor system.* <!-- greptile_comment --> <h3>Greptile Summary</h3> Fixed TypeScript compilation errors by adding missing `config` and `agentDir` parameters to the `maybeMarkAuthProfileFailure` function type definition. **Critical Issue:** - This PR conflicts with commit 6268ed57 on main which already fixed the underlying problem by renaming the parameter to avoid shadowing and using the outer scope's `agentDir` constant - The current approach adds these properties to the inner function's parameter type, but call sites don't pass these values, so they'll be `undefined` at runtime - The PR needs to be rebased on current main where the issue is already properly resolved <h3>Confidence Score: 0/5</h3> - This PR should not be merged as it conflicts with a fix already on main and will introduce runtime bugs - The PR is based on outdated code and conflicts with commit 6268ed57 which already fixed the parameter shadowing issue. Merging this would reintroduce the shadowing bug and cause `config` and `agentDir` to be undefined at runtime since call sites don't pass these values. - src/agents/pi-embedded-runner/run.ts requires rebasing on current main branch <sub>Last reviewed commit: c0e100f</sub> <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs