Fix codex mcp typecheck errors
This commit is contained in:
@@ -304,7 +304,6 @@ class CodexMcpAgentSession implements AgentSession {
|
|||||||
private sessionId: string | null = null;
|
private sessionId: string | null = null;
|
||||||
private conversationId: string | null = null;
|
private conversationId: string | null = null;
|
||||||
private runtimeModel: string | null = null;
|
private runtimeModel: string | null = null;
|
||||||
private modelRejected = false;
|
|
||||||
private pendingLocalId: string | null = null;
|
private pendingLocalId: string | null = null;
|
||||||
private persistence: AgentPersistenceHandle | null = null;
|
private persistence: AgentPersistenceHandle | null = null;
|
||||||
private cachedRuntimeInfo: AgentRuntimeInfo | null = null;
|
private cachedRuntimeInfo: AgentRuntimeInfo | null = null;
|
||||||
@@ -589,7 +588,8 @@ class CodexMcpAgentSession implements AgentSession {
|
|||||||
: response.interrupt
|
: response.interrupt
|
||||||
? "abort"
|
? "abort"
|
||||||
: "denied";
|
: "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");
|
this.flushQueuedToolEvents(requestId, response.behavior === "allow");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -679,7 +679,6 @@ class CodexMcpAgentSession implements AgentSession {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (config.model && isUnsupportedChatGptModelError(error)) {
|
if (config.model && isUnsupportedChatGptModelError(error)) {
|
||||||
const { model: _ignoredModel, ...fallback } = config;
|
const { model: _ignoredModel, ...fallback } = config;
|
||||||
this.modelRejected = true;
|
|
||||||
this.runtimeModel = null;
|
this.runtimeModel = null;
|
||||||
this.config.model = undefined;
|
this.config.model = undefined;
|
||||||
response = await attempt(fallback);
|
response = await attempt(fallback);
|
||||||
@@ -703,7 +702,6 @@ class CodexMcpAgentSession implements AgentSession {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const message = error instanceof Error ? error.message : String(error);
|
|
||||||
if (signal.aborted) {
|
if (signal.aborted) {
|
||||||
this.emitEvent({
|
this.emitEvent({
|
||||||
type: "turn_failed",
|
type: "turn_failed",
|
||||||
|
|||||||
@@ -106,10 +106,11 @@ Build a new Codex MCP provider side‑by‑side with the existing Codex SDK prov
|
|||||||
- These hacks hide bugs. The provider should work correctly or fail clearly.
|
- 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.
|
- **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`.
|
- Run `npm run typecheck --workspace=@paseo/server`.
|
||||||
- Fix `AgentPermissionResponse.message` and unused locals.
|
- 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.
|
- [ ] **Test (E2E)**: Run tests and verify fixes work.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user