Skip to content

feat(user sim): presets for the built-in user sim (chat, always_on, milestone) - #901

Closed
kaihackney-scale wants to merge 2 commits into
mainfrom
kai/user-sim-presets
Closed

kaihackney-scale wants to merge 2 commits into
mainfrom
kai/user-sim-presets

Conversation

@kaihackney-scale

@kaihackney-scale kaihackney-scale commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Why

The built-in user sim now plays different kinds of runs: a single chat, an always-on run over days, and a conversation in milestones that a post-turn hook checks. Today the kind is implicit (multi_day picks the done line, and a hook's notes just show up), so the sim's prompt and the judge's rules can't tell which kind of run they're in. That is how rules tuned for one kind reach sims of another.

What

deploy_user_sim_agent takes an optional preset:

Preset Prompt
chat today's single-session prompt, byte for byte
always_on today's multi-day prompt, byte for byte
milestone adds how the user takes a post-turn hook's note: trust it over the reply, press on what it raises in their own words and never more specifically, move on and send the line it gives only when it says so, answer done only after it says everything is done
  • Without a preset the sim is chat or always_on by multi_day, as before.
  • The user_sims record carries preset (as written) and features: the parts of the prompt and run a judge's rules may depend on (told_lines, should_know_lines, permission_rules, when_done, phone, milestones, hook_notes), from the persona's sections, its permissions and the preset. A judge can read them from the record instead of rebuilding or guessing the prompt.
  • Refused when the task loads (task_problems): a milestone user whose prompt_agent has no post_turn_hooks, a milestone user no prompt_agent talks to, and an always_on step playing a chat or milestone user. chat and milestone need multi_day: false.
  • user_sim.md documents the presets.

Tests

  • tst/unit/task_step/test_user_sim_presets.py (14): the always_on preset's prompt is the pinned one byte for byte (same sha256), chat matches today's single-session prompt, milestone adds the note lines and its done line, the prompt rebuilt from the record is the one the sim got, features follow the persona and preset, bad presets and presets that don't fit the task are refused at load.
  • task_step and task unit suites: 4746 passed; the 6 failures are the computer_exec and test_mcp_cli_builder tests that fail on main.

Live runs

A three-milestone task with a milestone-checking post-turn hook, run end to end twice with this branch merged locally with the hook:

  • Without a preset, the user sim answered done while the hook's note still said a milestone was failing, which ended the conversation early.
  • With preset: milestone, it no longer said done early, but once answered no_reply on a failing milestone, and once named an item from the assistant's own reply as what to add. The milestone prompt now says to always reply while a note says something isn't done, and to give no name or figure the note doesn't, the assistant's own included (78d6191). Not re-run yet.

Not yet

  • A live run with the tightened milestone prompt.
  • Judge rules aren't filtered by features yet; that's for the user-sim judge, which can read them from the record.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 4/5

The PR appears safe to merge, with a non-blocking correction needed for empty-section feature flags.

Fix All in CursorFindings

  1. P2 Empty sections count as present ▶
Fix with agent prompt
### Issue 1
src/agent_env/task_step/task_steps/agent/user_sim_versions.py:190-192
`features()` marks empty `already_told`, `should_already_know`, and `when_done` lists as present because `_lines([])` returns true. These lists are allowed, but `_section()` leaves them out of the prompt. A judge using these flags would select rules for sections the user never saw. Require a non-empty list here and add an empty-list test.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Adds chat, always_on, and milestone presets for the built-in user sim.

  • User sims now follow hook notes in milestone chats.
  • Run records show which user-sim features apply.

One non-blocking issue remains: empty persona sections are recorded as present.

kaihackney-scale explicitly deferred judge filtering and acknowledged that the tightened milestone prompt has not been re-run.

Reviews (1) · Last reviewed commit: "fix(user sim): a milestone user always r..." · Reviewed by Greptile

kaihackney-scale and others added 2 commits November 23, 2026 19:31
…ilestone)

deploy_user_sim_agent takes an optional preset naming the kind of run the user is in. chat and always_on keep
today's prompts byte for byte; milestone adds how the user takes a post-turn hook's note (trust it over the reply,
press on what it raises never more specifically, move on and send the next line only when it says so, done only
after everything is done). The step records the preset and features: the parts of the prompt and run a judge's
rules may depend on, from the persona's sections, its permissions and the preset. A preset that doesn't fit the
task's other steps is refused when the task loads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…thing isn't done

In a live run the user sim answered no_reply while the hook's note still said the milestone failed, which ended the
conversation, and once named an item from the assistant's own reply as what to add. The milestone preset now says to
always reply while a note says something isn't done, and to give no name or figure the note doesn't, the assistant's
own included.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment on lines +190 to +192
have = {feature for key, feature in (("already_told", "told_lines"), ("should_already_know", "should_know_lines"),
("when_done", "when_done"))
if _lines(description.get(key))}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Empty sections count as present

features() marks empty already_told, should_already_know, and when_done lists as present because _lines([]) returns true. These lists are allowed, but _section() leaves them out of the prompt. A judge using these flags would select rules for sections the user never saw. Require a non-empty list here and add an empty-list test.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/agent_env/task_step/task_steps/agent/user_sim_versions.py
Line: 190-192

Comment:
**Empty sections count as present**

`features()` marks empty `already_told`, `should_already_know`, and `when_done` lists as present because `_lines([])` returns true. These lists are allowed, but `_section()` leaves them out of the prompt. A judge using these flags would select rules for sections the user never saw. Require a non-empty list here and add an empty-list test.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Cursor Fix in Claude Code Fix in Codex

@kaihackney-scale

Copy link
Copy Markdown
Collaborator Author

Combined into #912, which carries this change together with the milestone-gates hook and the user-sim presets, so they're reviewed and merged as one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant