# Fisshing for Codex

Follow task status and answer questions from Profile → Agent Desk in Fisshing.
The plugin uses status hooks and three MCP tools: `ask_question`,
`wait_for_answer`, and `set_status`. Codex starts the tool process for you,
so there’s no server or sidecar to run. You need Node 20 or newer.

## Install

Download and extract the package. Keep the extracted directory at a stable path.

```sh
curl -fsSLO https://fisshing.net/integrations/fisshing-codex-plugin.tar.gz
tar -xzf fisshing-codex-plugin.tar.gz
codex plugin marketplace add ./fisshing-codex-marketplace
codex plugin add fisshing-codex@fisshing
```

Set `FISSHING_API_KEY` in the environment that starts Codex. Get the key from
Profile → API Key in the same Fisshing character you will use for replies.
Do not put it in a prompt or source file.

```sh
export FISSHING_API_KEY='your-key'
codex
```

For the desktop app, make this variable available to the app process, then restart
the app. Install the plugin, review and trust its hooks, and start a new task.
Enable the Agent Desk skill or ask Codex to send task status and questions to Fisshing.

## How replies work

The question tool sends the full question and choices to Fisshing. It waits for
up to 20 seconds, then returns an answer or a pending question id. Codex can call
`wait_for_answer` with that id while the question remains valid. Questions expire
after ten minutes. A timeout, error, or pending result never supplies an answer.

Codex sends questions through the plugin’s `ask_question` tool. It does not intercept Codex's
built-in question prompt. The current documented hook output can rewrite tool
arguments but does not provide a supported replacement answer for that prompt.
Keep command and file approvals in Codex.

Status hooks report when a task starts, runs a tool, or stops, along with the folder name. They do not upload
transcripts, prompts, file contents, or tool results. `set_status` can send a
short summary when you request one. An idle agent can show “No recent update”
between updates. The agent may still be running.

Agent tokens stay in private files under `~/.local/state/fisshing/codex`.
Set `FISSHING_PLUGIN_STATE_DIR` to change that path. Remove an agent in Agent Desk
to revoke its token. Remove that session's local cache file before reconnecting
it. The player key stays in the environment and is used only for registration.

## References and checks

- [Codex hooks](https://learn.chatgpt.com/docs/hooks)
- [Codex plugins](https://learn.chatgpt.com/docs/build-plugins)
- [MCP stdio transport](https://modelcontextprotocol.io/specification/2024-11-05/basic/transports)

The manifest and skill pass the Codex validators. Tests cover exact question
matching, timeout, cancellation, status hooks, and tool results. The MCP SDK
client verifies handshake, tool discovery, ping, and missing-key behavior.
