[v0.8 replacement 3/5] reconcile harness lifecycle - #2326
Open
sethkarten wants to merge 4 commits into
Open
Conversation
sethkarten
marked this pull request as ready for review
August 12, 2026 06:18
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ 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.
ApprovabilityVerdict: 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. |
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.

Replacement stack
Node 3/5 in a fresh append-only v0.8 replacement chain rooted at authoritative
maincommitc2820d3679e6318f9c3d0155c823d6908b4e1faa.v080/main-replacement-acp-metav080/main-replacement-harness-lifecycle525a3374c54d1632bc23581a29d0e31c4c3b0c39Scope
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.lockare unchanged across replacement nodes.Warning
TEST BLOCKED — do not merge or mark ready. Authoritative
c2820dhas a staleuv.lockrelative topyproject.toml. A disposableuv sync --lockedcorrectly refused before tests, without changing repository files. The only previously approved interpreter also cannot import current main becausepydantic_configis 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
PrimeAgentHarnessHarness.resolved_skills()in harness.py to validate skill folders and raiseValueErroron duplicate basenames;install_skills,PiHarness.launch, andPrimeAgentHarness._preparenow delegate to this method.OpenClawHarness.launchnow writesmodels.mode='replace'in openclaw/harness.py, preventing merges with built-in providers.PrimeAgentHarness.cleanupin prime_agent/harness.py to delete per-trace tmp then state root in two separate steps, perform a socket existence check, and raiseSandboxError(with retry path context) on any socket, daemon stop, or deletion failure.cleanupnow raisesSandboxErroron 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.cleanupis reworked: socket check and daemon stop still gate deletion, but per-trace tmp and state root are removed in separaterm -rfsteps with validated runtime results. Failures raiseSandboxError(notRuntimeError) and include retry paths plus what was already removed. Stop failures block anyrm.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
interceptprovider and OpenClawmodels.mode: replacestay 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.