Skip to content

feat(v1): import interaction history - #2142

Closed
hallerite wants to merge 1 commit into
mainfrom
codex/history-import
Closed

feat(v1): import interaction history#2142
hallerite wants to merge 1 commit into
mainfrom
codex/history-import

Conversation

@hallerite

@hallerite hallerite commented Jul 27, 2026

Copy link
Copy Markdown
Member

Summary

  • add Agent.interaction(..., history=...) for pre-existing, role-preserving conversation context that remains unsampled in the trace
  • add an explicit harness bootstrap contract for importing history before the first live turn
  • enable the default typed Messages bootstrap only for the stateless null and bash harnesses; unsupported harnesses reject history import early
  • add end-to-end coverage based on the Tau-style seeded assistant greeting

Codex is intentionally unchanged and does not opt into history import in this PR.

Validation

  • uv run ruff check --fix .
  • uv run ruff format --check .
  • uv run ty check verifiers
  • uv run pytest tests/ — 909 passed, 63 credential-gated tests skipped
  • uv run pre-commit run --all-files

Note

Add interaction history import to v1 agent and harness

  • Adds a history: Messages | None parameter to Agent.interaction and RolloutRun, passing imported conversation context to the harness on the first step only.
  • Adds Harness.bootstrap() as a default mechanism to merge imported history with a live opening turn before calling launch(), gated by a new SUPPORTS_HISTORY_IMPORT class flag.
  • BashHarness and NullHarness opt in by declaring SUPPORTS_HISTORY_IMPORT = True; other harnesses raise a ValueError if history is provided without overriding bootstrap().
  • Updates the EchoUserSimEnv fixture to seed interactions with a system message and assistant greeting via the new history parameter, and updates its reward to require exactly one imported greeting message.
  • Behavioral Change: interactions that pass history to a harness that does not declare support now raise a ValueError at setup time.

Macroscope summarized 31110ca.


Note

Medium Risk
Touches core rollout and harness segment routing; mistakes could mis-order conversation or double-count system prompts, though unsupported harnesses are rejected up front and only stateless null/bash opt in.

Overview
Adds history= on Agent.interaction (and episode agents) so rollouts can start with pre-existing, role-preserving messages before the first live user turn. Those messages land in the trace as unsampled context, not as model turns.

The harness layer gets a bootstrap() path when history is set on the first segment: default behavior merges imported messages with the opening turn and **launch()**es (with system-prompt de-duplication like resume()). Harnesses must declare SUPPORTS_HISTORY_IMPORT or override bootstrap(); null and bash opt in. Unsupported harnesses fail early via _check_interaction_support.

RolloutRun carries history only through the first step(), then clears it so later segments use normal launch/resume.

E2E coverage uses the echo user-sim fixture with a seeded assistant greeting and asserts imported system/assistant nodes in the trace.

Reviewed by Cursor Bugbot for commit 31110ca. Bugbot is set up for automated code reviews on this repo. Configure here.

@hallerite
hallerite marked this pull request as ready for review July 27, 2026 12:32
@macroscopeapp

macroscopeapp Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

Unable to check for correctness in 31110ca. New feature that adds history import capability to the interaction system. Introduces new bootstrap() method, capability flags, and parameters propagated through multiple core layers (agent, rollout, harness) - warrants human review for new functionality.

You can customize Macroscope's approvability policy. Learn more.

@hallerite
hallerite force-pushed the codex/history-import branch 3 times, most recently from 0cccd71 to 3ee3c50 Compare July 27, 2026 14:34
Comment thread verifiers/v1/harnesses/codex/app_server.py Outdated
@hallerite
hallerite force-pushed the codex/history-import branch from 3ee3c50 to 3665ad5 Compare July 27, 2026 16:19

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 3665ad5. Configure here.

Comment thread verifiers/v1/harness.py
@hallerite
hallerite force-pushed the codex/history-import branch from 3665ad5 to 31110ca Compare July 27, 2026 16:58
@hallerite

Copy link
Copy Markdown
Member Author

closing for now, as only Tau needs this

@hallerite hallerite closed this Jul 28, 2026
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