Skip to content

[v0.8 replacement 3/5] reconcile harness lifecycle - #2326

Open
sethkarten wants to merge 4 commits into
v080/main-replacement-acp-metafrom
v080/main-replacement-harness-lifecycle
Open

[v0.8 replacement 3/5] reconcile harness lifecycle#2326
sethkarten wants to merge 4 commits into
v080/main-replacement-acp-metafrom
v080/main-replacement-harness-lifecycle

Conversation

@sethkarten

@sethkarten sethkarten commented Aug 11, 2026

Copy link
Copy Markdown

Replacement stack

Node 3/5 in a fresh append-only v0.8 replacement chain rooted at authoritative main commit c2820d3679e6318f9c3d0155c823d6908b4e1faa.

  • Base branch: v080/main-replacement-acp-meta
  • Head branch: v080/main-replacement-harness-lifecycle
  • Exact head: 525a3374c54d1632bc23581a29d0e31c4c3b0c39

Scope

Exact coherent #2310 lifecycle/model-ID/skills delta: 7 paths; unrelated install newline drift excluded.

The old contributor PR branches remain untouched. This branch was published non-force from a fresh owned repository. Independent Luna semantic review APPROVED the full N1→N5 chain and found no structural scope leakage; authoritative-main renderer provenance is retained and pyproject.toml / uv.lock are unchanged across replacement nodes.

Warning

TEST BLOCKED — do not merge or mark ready. Authoritative c2820d has a stale uv.lock relative to pyproject.toml. A disposable uv sync --locked correctly refused before tests, without changing repository files. The only previously approved interpreter also cannot import current main because pydantic_config is absent. Testing/remediation continues on GitHub; this draft does not claim green.

No live, hosted, Docker, sandbox, model, or paid evaluation was run.

Note

Reconcile harness lifecycle with skill validation and robust cleanup in PrimeAgentHarness

  • Introduces Harness.resolved_skills() in harness.py to validate skill folders and raise ValueError on duplicate basenames; install_skills, PiHarness.launch, and PrimeAgentHarness._prepare now delegate to this method.
  • OpenClawHarness.launch now writes models.mode='replace' in openclaw/harness.py, preventing merges with built-in providers.
  • Rewrites PrimeAgentHarness.cleanup in prime_agent/harness.py to delete per-trace tmp then state root in two separate steps, perform a socket existence check, and raise SandboxError (with retry path context) on any socket, daemon stop, or deletion failure.
  • Adds test coverage for harness model ID isolation, skill staging collision detection, and the new cleanup behavior.
  • Risk: cleanup now raises SandboxError on previously-silent failures (e.g. unknown exit codes, timeouts), changing error propagation for callers.

Macroscope summarized 95cee3a.


Note

Medium Risk
Prime Agent cleanup behavior and exception types change on rollout teardown; incorrect handling could leave daemon state or mis-attribute failures, though changes are heavily tested.

Overview
Adds Harness.resolved_skills() so duplicate skill folder basenames fail before staging or CLI construction; install_skills, Pi, and Prime Agent now route skill paths through it.

PrimeAgentHarness.cleanup is reworked: socket check and daemon stop still gate deletion, but per-trace tmp and state root are removed in separate rm -rf steps with validated runtime results. Failures raise SandboxError (not RuntimeError) and include retry paths plus what was already removed. Stop failures block any rm.

New hermetic tests cover skill staging, OpenClaw/Pi model-ID intercept config, and Prime Agent cleanup edge cases (partial failure, idempotent retry, indeterminate runtime). OpenClaw/Pi comments clarify why the private intercept provider and OpenClaw models.mode: replace stay isolated from built-in catalogs.

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

@sethkarten
sethkarten marked this pull request as ready for review August 12, 2026 06:18

@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 2 potential issues.

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 525a337. Configure here.

Comment thread verifiers/v1/harnesses/openclaw/harness.py
Comment thread verifiers/v1/harnesses/openclaw/harness.py
@macroscopeapp

macroscopeapp Bot commented Aug 12, 2026

Copy link
Copy Markdown

Approvability

Verdict: Needs human review

While tests comprise most of the diff, the PR includes a significant refactor of cleanup lifecycle infrastructure in PrimeAgentHarness - changing error types, sequential deletion semantics, and adding error tracking helpers. This major infrastructure refactor warrants human review.

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

@sethkarten
sethkarten requested a review from hallerite August 13, 2026 01:25
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