.agents/skills/custom-codereview-guide.md
This guide supplements the public code-review skill with rules specific to
OpenHands/OpenHands, the Agent Canvas frontend. Read AGENTS.md first; it is
the detailed source of truth for current architecture and test conventions.
Be direct and constructive. Review correctness and architecture, not formatting that lint or the compiler already checks.
Put behavior in the repository that owns it:
| Repository | Owns |
|---|---|
OpenHands/OpenHands | Agent Canvas UI, frontend state, backend selection, frontend service integration, and local-stack orchestration |
OpenHands/software-agent-sdk | Agent Server, agents, tools, conversations, events, workspaces, and the canonical server API |
OpenHands/typescript-client | Browser-compatible typed access to the Agent Server API |
OpenHands/extensions | Reusable skills, plugins, and integrations |
OpenHands/automation | Scheduling, webhooks, run history, and automation dispatch |
The normal dependency direction is Agent Server contract → TypeScript client → Canvas. Flag raw endpoint reimplementations, Canvas-local copies of server contracts, and changes opened in the wrong repository.
Agents tend to copy the nearest pattern and choose the shortest compiling path. Review the codebase as part of the product surface that guides those choices:
Treat “deep module” as a design heuristic, not a line-count target. A good module has a narrow, stable interface and hides cohesive complexity. Do not split a file merely because it is long, and do not create layers that only rename or forward arguments. Prefer a small pure seam when it removes duplicated decisions, makes ownership explicit, or enables focused tests.
useEffect is for synchronizing React with an external system. Flag effects used
to:
An effect is not automatically wrong. Subscription, browser API, timer, and network synchronization still belong in effects when cleanup and dependency semantics are explicit.
src/api/no-direct-agent-server-calls.test.ts is the executable source of truth.
Do not approve new raw fetch, axios, shared openHands, or low-level HTTP
client access to Agent Server endpoints. Use @openhands/typescript-client with
the options from src/api/agent-server-client-options.ts.
Cloud and runtime-sandbox requests must go through callCloudProxy; runtime
requests must provide the correct hostOverride and authentication mode. Review
changes to the guard's allowlist as architecture changes. Do not copy its current
entries into this guide—the test should remain the one authoritative list.
The SDK event model is the wire authority, the TypeScript client mirrors it, and Canvas consumes the published client type. Do not approve Canvas-local redeclarations, partial intersections, module augmentation, or presentation fields added to wire-event interfaces.
A contract change should land in this order:
Canvas-only presentation state belongs in a separate view model keyed by event identity.
src/services/telemetry.ts is the only owner of the Canvas PostHog client.src/hooks/use-tracking.ts; components
must not call PostHog directly.setTelemetryConsent remains the single consent controller.package.json and
package-lock.json synchronized through npm; do not hand-edit one side only.__tests__/package-library.test.ts is the executable
source of truth for allowed specs.AGENTS.md. If a change crosses a full-stack flow
and lacks suitable coverage, recommend mock-LLM E2E and add the e2e-tests
label when appropriate.Do not leave review comments for:
.pr/ artifacts, which are cleaned up by repository automation.When raising a finding, trace the relevant call or data flow far enough to show the concrete failure mode. Prefer one high-signal comment over several symptoms of the same ownership problem.