Fix codex mcp typecheck errors

This commit is contained in:
Mohamed Boudra
2025-12-24 19:28:02 +07:00
parent 29301ba430
commit c1761a52f2
2 changed files with 4 additions and 5 deletions

View File

@@ -304,7 +304,6 @@ class CodexMcpAgentSession implements AgentSession {
private sessionId: string | null = null;
private conversationId: string | null = null;
private runtimeModel: string | null = null;
private modelRejected = false;
private pendingLocalId: string | null = null;
private persistence: AgentPersistenceHandle | null = null;
private cachedRuntimeInfo: AgentRuntimeInfo | null = null;
@@ -589,7 +588,8 @@ class CodexMcpAgentSession implements AgentSession {
: response.interrupt
? "abort"
: "denied";
pending.resolve({ decision, reason: response.message });
const reason = response.behavior === "deny" ? response.message : undefined;
pending.resolve({ decision, reason });
this.flushQueuedToolEvents(requestId, response.behavior === "allow");
}
@@ -679,7 +679,6 @@ class CodexMcpAgentSession implements AgentSession {
} catch (error) {
if (config.model && isUnsupportedChatGptModelError(error)) {
const { model: _ignoredModel, ...fallback } = config;
this.modelRejected = true;
this.runtimeModel = null;
this.config.model = undefined;
response = await attempt(fallback);
@@ -703,7 +702,6 @@ class CodexMcpAgentSession implements AgentSession {
);
}
} catch (error) {
const message = error instanceof Error ? error.message : String(error);
if (signal.aborted) {
this.emitEvent({
type: "turn_failed",

View File

@@ -106,10 +106,11 @@ Build a new Codex MCP provider sidebyside with the existing Codex SDK prov
- These hacks hide bugs. The provider should work correctly or fail clearly.
- **Done (2025-12-24 19:25)**: Reviewed codex-mcp-agent.ts and cataloged all workaround/fallback logic with required real fixes.
- [ ] **Fix**: Resolve typecheck errors in `codex-mcp-agent.ts`.
- [x] **Fix**: Resolve typecheck errors in `codex-mcp-agent.ts`.
- Run `npm run typecheck --workspace=@paseo/server`.
- Fix `AgentPermissionResponse.message` and unused locals.
- **Done (2025-12-24 19:27)**: Removed unused locals, avoided invalid permission message access, and reran server typecheck.
- [ ] **Test (E2E)**: Run tests and verify fixes work.