[RFC]: Support multi-step tasks with simulated users
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- python
- Domain
- backend-api-design
Research direction
Start with src/harbor/trial/trial.py, src/harbor/trial/multi_step.py, src/harbor/models/task/config.py, and src/harbor/bridges/base.py; trace how a multi-step trial runs and how bridges and user agents are resumed and closed. Then inspect the existing tests for these paths and add coverage for step transitions, timeouts, persona selection, and log archiving. The work is done when simulated users can run across steps and bridge cleanup and verification follow the proposed lifecycle.
Written by the indexing model from the issue text.
Description
Follow-up RFC for #4463 , based on main (5d8c4586).
Motivation
MultiStepTrial.__init__ currently rejects config.user_agent is not None. Task authors need simulated users inside [[steps]] tasks so each step can be graded against the live container state while keeping conversation and workspace history across steps (#4426 only stages files at checkpoints, without live per-step verification).
Proposed changes
-
Keep the bridge alive across steps (
src/harbor/trial/trial.py,src/harbor/trial/multi_step.py)- Remove the
config.user_agent is not Noneguard inMultiStepTrial.__init__. - Add
close_bridge: bool = TruetoTrial._run_agent_phase(MultiStepTrial._run_step_agentpassesFalse). - Call
BaseBridge.export_trajectoryafter each step intosteps/<name>/agent/bridge-trajectory.jsonwithout callingteardown. - Close the bridge before
_stop_agent_environment()on every exit path (normal finish,min_rewardabort,SEPARATElast step, and_recover_outputs) so the bridge never loses container access before exporting logs or cleaning up.
- Remove the
-
Carry conversation state for both agents
- Target agent keeps its live ACP session in the bridge (no restart/
resume()). - User agent runs
user_agent.run()on step 1 anduser_agent.resume()on steps 2+. - Update
MultiStepTrial._validate_resume_supportto checkself.user_agent.capabilities.resumewhenuser_agentis set andlen(steps) > 1.
- Target agent keeps its live ACP session in the bridge (no restart/
-
Per-step user persona (
src/harbor/models/task/config.py)- Add optional
user_persona_path: Path | None = NonetoStepConfigandsteps/<name>/user_persona.mdconvention onTask. - Precedence:
step.user_persona_path>steps/<name>/user_persona.md>user_agent.user_persona_path>DEFAULT_USER_PERSONA. - On steps 2+, pass the step instruction to
user_agent.resume()and only include the persona if it changed.
- Add optional
-
Confirm target agent stops before verification on step timeout (
src/harbor/bridges/base.py)- Add
async def cancel_turn(self, environment: BaseEnvironment, timeout_sec: float = ...) -> booltoBaseBridge(defaultTrue; ACP sendssession/canceland waits for the turn to settle). - Call it on
AgentTimeoutErrorbefore step verification. If it returnsFalse, force-close the bridge / kill the target before grading and abort remaining steps so the verifier never races with a live writer.
- Add
-
Per-step
user_agent/log archiving- Mirror
agent_dirarchiving foruser_agent_dirintosteps/<name>/user_agent/, preserving it across steps when step N+1 resumes.
- Mirror
Open questions
- On steps 2+, should we omit
bridge_instructionsand only inject changed personas, or letuser_prompt_template_pathgovern resumed prompts too? - Should
StepResultadduser_agent_result: AgentContext | Nonefor per-step token/cost tracking, or keep it trial-level only?
cc @kobe0938 @alexgshaw @jackdonaldson-surge
- Dominant language
- Python
- Stars
- 5.6k
- Forks
- 1.9k
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 156
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from harbor-framework/harbor
-
Trial runs the agent's `populate_context_post_run` on the event loop, so trials that end together stall the orchestrator for secondsPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
harbor-framework/harbor#4652 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
harbor-framework/harbor#4494 · 1 comment ·
Maintainers usually reply within 1 day
-
step workdir upload resets the work folder's owner and permissions in ModalPossibly taken @Sauvi72 claimed this 8 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
harbor-framework/harbor#4487 · 3 comments ·
Maintainers usually reply within 1 day
-
Docker: verifier log mounts are chmod 777 (no sticky), so rewardkit sandboxed graders die before writing a rewardPossibly taken @yuyz-cyber claimed this 6 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
harbor-framework/harbor#4469 · 1 comment ·
Maintainers usually reply within 1 day
-
Compare and Pareto hide total token usage when the cached token count is missingPossibly taken @Aafimalek claimed this 10 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
harbor-framework/harbor#4448 ·
Maintainers usually reply within 1 day
All issues in harbor-framework/harbor
Similar issues
-
soup prune-prompt exits 1 after writing its output on a file over 100,000 rows, and reports a capped row count otherwisePossibly taken @abdulwaarith0 claimed this today. Openneeds-triage
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
MakazhanAlpamys/Soup#3690 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug data-types native-format
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
ClickHouse/clickhouse-connect#1320 ·
Maintainers usually reply within 1 day
-
accepted
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
future-agi/future-agi#6392 ·
Maintainers usually reply within 1 day