Repository navigation
Conversation
Add "Build a Tool-Use Environment with Seahaven" under Learn > Basics. It builds a small CRM world (one table, three tools), freezes a fixture, serves it with `seahaven serve`, drives an episode with OpenEnv's GenericEnvClient (reset with a fixture and seed, ListToolsAction, CallToolAction), and grades the episode from the change log in state(). It notes that Seahaven environments return no reward, unlike the OpenEnv convention, and uses Stripe World as the real example. Also add one sentence to the README's "Build your own environment" section pointing to the tutorial. Every code block was run end to end against Seahaven 0.5.0 and 0.6.0, with the client on openenv 0.5.0, 0.8.0 and main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Uxf3k6Fcyfm5Jmt8d4HDfA
The main README isn't the right place for a Seahaven pointer, so restore README.md to match main. The tutorial and its toctree entry stay. Stripe World added an account table (Kiln-AI/stripe_world#16), so the tutorial's Stripe World paragraph now says 25 tables instead of 24. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Uxf3k6Fcyfm5Jmt8d4HDfA
# Conflicts: # docs/source/_toctree.yml
burtenshaw
left a comment
There was a problem hiding this comment.
ALIGNMENT FLAG: rewards are computed outside the environment. The tutorial explicitly grades state() in caller code and says observations always have reward=None. This conflicts with the rewards-in-environment invariant (and leaves the documented path incompatible with CollectRunner). Please have @Darktex review whether to permit this documented exception or require a server-side reward adapter before presenting it under Basics. The disclosure is useful, but does not itself settle the architecture decision.
|
@Darktex thoughts on @burtenshaw's comment? For this class of environment, rewards outside the environment is an intentional design decision. It's a large stateful environment modelling a real company/API (e.g. the Stripe API). Unlike chess or Atari, there's no inherent reward signal in the env. An agent could be given any task, and needs to be rewarded against that task. Examples on a Stripe environment:
So the reward belongs with the task set (the harness), not the environment. The environment's job is to expose state that graders can check against (in the tutorial, a row-level change log from |
Summary
Adds a tutorial for building a stateful tool-use environment with Seahaven, a framework whose
seahaven servehosts an OpenEnv environment. Each "world" is a working copy of a tool or API, backed by SQLite. Designed for long-horizon open-goal agents, in realistic tool environments.The tutorial builds a small CRM world with one table and three tools, freezes a fixture, serves it, and drives an episode with OpenEnv's own
GenericEnvClient(resetwith a fixture and seed,ListToolsAction,CallToolAction). It then grades the episode from the row-level change log thatstate()returns.docs/source/tutorials/seahaven-environment.md: the new page.docs/source/_toctree.yml: adds it under Learn → Basics.Type of Change
Alignment Checklist
.claude/docs/PRINCIPLES.mdand this PR aligns with our principles.claude/docs/INVARIANTS.mdand no invariants are violated/pre-submit-pr(orbash .claude/hooks/lint.shand tests) and addressed all issuesNote on invariant 3 (rewards inside the environment): a Seahaven environment returns
reward=Noneand leaves grading to the caller. The tutorial says this plainly, links to Reward Design, and notes that the harness rollout helpers require an environment-produced reward.RFC Status
Test Plan
openenv0.8.0 from PyPI, on 0.5.0, and on this repo's main. The printed output and the change log shown in the page match the run.python scripts/sync_env_docs.py --checkpasses and_toctree.ymlparses.Claude Code Review
N/A, docs
Note
Low Risk
Documentation-only changes with no runtime or API modifications.
Overview
Adds a Learn → Basics doc that walks through building a stateful tool-use environment with Seahaven: scaffold a CRM world, define SQLite schema and
@world.toolhandlers, freeze a fixture, runseahaven serve, drive an episode withGenericEnvClient(reset,ListToolsAction,CallToolAction), and grade from the row change log returned bystate().The page also calls out how this pattern differs from typical OpenEnv environments—rewards stay
Noneon the server and grading lives in the driver—and notes thatCollectRunner/build_harness_rollout_funcexpect environment-produced rewards.docs/source/_toctree.ymllinks the page as "Tool-Use Environments (Seahaven)".Reviewed by Cursor Bugbot for commit 724e466. Bugbot is set up for automated code reviews on this repo. Configure here.