Repository navigation
feat(user sim): presets for the built-in user sim (chat, always_on, milestone) - #901
Closed
kaihackney-scale wants to merge 2 commits into
Closed
kaihackney-scale wants to merge 2 commits into
kaihackney-scale wants to merge 2 commits into
Conversation
…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))} |
There was a problem hiding this 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.
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.
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_daypicks 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_agenttakes an optionalpreset:chatalways_onmilestonechatoralways_onbymulti_day, as before.user_simsrecord carriespreset(as written) andfeatures: 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.task_problems): amilestoneuser whoseprompt_agenthas nopost_turn_hooks, amilestoneuser noprompt_agenttalks to, and analways_onstep playing achatormilestoneuser.chatandmilestoneneedmulti_day: false.user_sim.mddocuments 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.computer_execandtest_mcp_cli_buildertests 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:
donewhile the hook's note still said a milestone was failing, which ended the conversation early.preset: milestone, it no longer saiddoneearly, but once answeredno_replyon 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
featuresyet; that's for the user-sim judge, which can read them from the record.🤖 Generated with Claude Code
The PR appears safe to merge, with a non-blocking correction needed for empty-section feature flags.
Fix with agent prompt
Summary
Adds
chat,always_on, andmilestonepresets for the built-in user sim.One non-blocking issue remains: empty persona sections are recorded as present.
kaihackney-scaleexplicitly 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