Skip to content
Draft
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
8 changes: 8 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,11 @@ const table = sqliteTable("session", {
- Keep delivery vocabulary explicit. Prompts steer by default and promote at the next safe provider-turn boundary while the current drain requires continuation. An explicit `queue` input remains pending until the Session would otherwise become idle; promote one queued input at that boundary, then reevaluate continuation before promoting another. Promoting any new user input resets the selected agent's provider-turn allowance; a batch of steers resets it once.
- Keep EventV2 replay owner claims separate from clustered Session execution ownership.
- Keep the System Context algebra, registry, and built-ins in `src/system-context`; keep Context Source producers with their observed domains, and keep Session History selection plus Context Epoch persistence Session-owned.

## Cursor Cloud specific instructions

- Runtime is **Bun 1.3.14** (pinned in root `package.json` `packageManager`). It is installed at `~/.bun/bin` and added to `~/.bashrc`. A non-login shell (`bash -c`) will NOT have `bun` on `PATH`; prefix commands with `export PATH="$HOME/.bun/bin:$PATH"` if `bun: command not found`.
- Standard dev/lint/test/typecheck commands live in `CONTRIBUTING.md` and root `package.json` scripts; use those. Tests must run from a package dir (e.g. `cd packages/opencode && bun test test/util`), never from repo root (guard blocks it).
- `bun run lint` on a clean `dev` checkout currently reports thousands of warnings plus one pre-existing error (an e2e spec type assertion). This is baseline, not caused by your changes.
- **No LLM provider API keys are provisioned by default.** The opencode agent needs a provider to actually answer prompts. To exercise the full agent flow without real credentials, configure a custom OpenAI-compatible provider pointing at a local mock via `OPENCODE_CONFIG_CONTENT` (works process-wide across all server instances, which otherwise load config per-request via the `x-opencode-directory` header). Example config JSON: `{"model":"mock-local/test-model","provider":{"mock-local":{"npm":"@ai-sdk/openai-compatible","env":[],"models":{"test-model":{"tool_call":true,"limit":{"context":128000,"output":4096}}},"options":{"apiKey":"dummy","baseURL":"http://127.0.0.1:9099/v1"}}}}`. For real models, add a provider key as a secret instead.
- Running the app: headless server is `bun dev serve --port 4096` (from repo root; note `bun dev` runs with cwd `packages/opencode`). The web UI dev server is `bun dev -- --port 4444` from `packages/app`, which targets the backend at `http://localhost:4096`. Add a project (e.g. `/workspace`) and create a session to reach the chat.