Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ Use [OpenAI Codex](https://github.com/openai/codex) from [Agent Client Protocol]
- Text prompts, embedded context, images, resource links, and additional workspace directories.
- Shell command, file change, permission request, MCP tool call, terminal output, reasoning, plan, web search, image generation, image view, token usage, and review events.
- Subagent launches as standard ACP tool calls, with Codex thread identity and activity details in namespaced `_meta.codex.subagent` metadata.
- Session-scoped long-running goals through the provider-neutral [goal extension](docs/goal-extension.md).
- Client-provided MCP servers over command-based stdio config and HTTP transport.
- Native ACP session forking through Codex App Server `thread/fork`.
- Acknowledged steering of an active Codex turn through app-server `turn/steer`.
- Slash commands: `/status`, `/mcp`, `/skills`, `/review`, `/review-branch`, `/review-commit`, `/compact`, and `/logout`, as well as configured skills.
- Slash commands: `/status`, `/mcp`, `/skills`, `/goal`, `/review`, `/review-branch`, `/review-commit`, `/compact`, and `/logout`, as well as configured skills.

## Installation

Expand Down
57 changes: 57 additions & 0 deletions docs/goal-extension.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Goal extension

This document defines a provider-neutral experimental ACP extension implemented by `codex-acp`. It is intentionally shaped like a possible future first-class ACP API: implementations publish `_meta.goal`, not provider-specific metadata such as `_meta.codex.goal`.

## Capability negotiation

An agent advertises support in its `initialize` response:

```json
{
"_meta": {
"goal": {
"version": 1,
"controlMethod": "_session/goal",
"actions": ["set", "pause", "resume", "clear"]
}
}
}
```

`actions` is the implementation-supported subset of `set`, `pause`, `resume`, and `clear`. Clients must not infer support for an action that is not advertised. The control request contains `sessionId` and `action`; `set` additionally requires a non-blank `objective`.

## Session state

The current snapshot is published in `session_info_update._meta.goal`. Clearing a goal publishes `goal: null`.

```json
{
"objective": "Ship the change",
"status": "active",
"createdAt": 1710000000000,
"updatedAt": 1710000012000,
"tokenBudget": null,
"tokensUsed": 42,
"timeUsedSeconds": 12,
"controlMethod": "_session/goal"
}
```

Common statuses are `active`, `paused`, `blocked`, `limited`, and `complete`. Optional fields allow implementations to report budgets, usage, iteration count, and the last continuation reason. Timestamps are Unix milliseconds.

## Lifecycle architecture

A goal belongs to the ACP session, not to an individual `session/prompt` request. Goal activity and prompt activity are independent:

- `status: active` means the persistent objective can drive more work; it does not mean an ACP prompt is currently executing.
- A prompt completes when its current backend turn reaches a quiescent boundary, even when the goal remains active.
- A later autonomous cycle may publish more session updates outside that completed prompt.
- While a turn is running, clients use steering or prompt queueing when advertised. While the session is quiescent, clients may send an ordinary `session/prompt`.

This separation prevents a persistent goal from monopolizing the session's prompt slot and lets clients model “working now” independently from “objective remains active.”

## Codex mapping and compatibility

Codex `thread/goal/*` notifications map into the neutral snapshot. Provider statuses `usageLimited` and `budgetLimited` map to `limited`; Codex second-based timestamps are converted to Unix milliseconds. `/goal` remains the user-facing way to set, pause, resume, or clear a goal.

`_codex/session/goal_control` remains accepted as a legacy alias, but new clients discover and use `_session/goal`. The alias is not advertised and no provider-specific goal metadata is emitted.
116 changes: 51 additions & 65 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"publishConfig": {
"access": "public"
},
"version": "1.3.0",
"version": "1.4.0",
"description": "An ACP-compatible coding agent powered by Codex",
"main": "dist/index.js",
"bin": {
Expand Down Expand Up @@ -71,7 +71,7 @@
},
"dependencies": {
"@agentclientprotocol/sdk": "^1.3.0",
"@openai/codex": "^0.145.0",
"@openai/codex": "^0.147.0",
"diff": "^9.0.0",
"open": "^11.0.0",
"vscode-jsonrpc": "^9.0.1",
Expand Down
Loading