Implementation:0xsline OpenChatCut Codex Agent Contract
Appearance
| Knowledge Sources | |
|---|---|
| Domains | Agent, Codex, Types |
| Last Updated | 2026-10-22 14:00 GMT |
Overview
Shared contract for Codex agent communication, defining turn request/response types, stream events, and tool result types.
Description
The Codex Agent Contract module defines shared types for Codex agent communication: `CodexTurnRequest`, `CodexTurnStreamEvent`, `CodexToolResultRequest`, `CodexAgentStatus`, and related interfaces. Used by both the server plugin and shared modules.
Usage
- Codex agent:*** Shared types between server, agent plugin, and client.
Code Reference
Source Location
- Repository:*** OpenChatCut
- File:*** shared/codex-agent.ts
- Lines:*** 1-95
Signature
export interface CodexTurnRequest {
prompt: string;
threadId: string | null;
tools: CodexAgentToolSpec[];
}
export type CodexTurnStreamEvent =
| { type: 'text'; text: string }
| { type: 'tool_request'; toolCallId: string; name: string; args: unknown }
| { type: 'done'; summary: string }
| { type: 'error'; message: string };
Import
import type { CodexTurnRequest, CodexTurnStreamEvent } from '../shared/codex-agent.ts';
I/O Contract
This module exports types only.
Usage Examples
Using Codex Types
import type { CodexTurnStreamEvent } from '../shared/codex-agent.ts';
function handleEvent(event: CodexTurnStreamEvent) {
if (event.type === 'text') console.log(event.text);
}
Related Pages
Requires Environment
Page Connections
Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment