[v0.8 replacement 2/5] preserve ACP metadata - #2325
Conversation
ApprovabilityVerdict: Needs human review This PR enables ACP metadata preservation across all harnesses, introducing new runtime behavior with timing-sensitive async logic for collecting late metadata updates. The cross-cutting nature of changes and new feature enablement warrants human verification. No code changes detected at You can customize Macroscope's approvability policy. Learn more. |
# Conflicts: # verifiers/v1/acp/__init__.py
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c7a1bde. Configure here.
| # Keep those in acp_meta history, but start a fresh live-response bucket at the | ||
| # prompt boundary so pre-prompt metadata neither leaks into this response nor | ||
| # shortens the first-event grace period below. | ||
| client.turn_acp_meta = {} |
There was a problem hiding this comment.
Live path drops pre-prompt meta
Medium Severity
prompt clears turn_acp_meta at the prompt boundary while comments claim pre-prompt SessionInfoUpdate events stay in acp_meta, but the live stream only returns turn_acp_meta. Cumulative acp_meta is written only on the one-shot path via write_meta, so session-start and resume metadata never reaches the host trace for live ACP sessions.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit c7a1bde. Configure here.


Replacement stack
Node 2/5 in a fresh append-only v0.8 replacement chain rooted at authoritative
maincommitc2820d3679e6318f9c3d0155c823d6908b4e1faa.v080/main-replacement-prime-harnessv080/main-replacement-acp-meta2d0f15ce63529c30e7a8b3ae7ebffc7d96d722b0Scope
Exact coherent #2286 ACP metadata preservation delta: 21 paths; patch-id preserved.
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
Preserve ACP metadata into rollout traces across all agent harnesses
_record_acp_metain acp/init.py to accumulate per-namespace ACPSessionInfoUpdatemetadata event lists ontotrace.info['acp_meta']without flattening or overwriting history.ACP.runandACP._runto accept atraceargument; after a one-shot run, readsmeta.jsonfrom disk and records it via_record_acp_meta.field_metaevents into global and per-turn metadata buckets; addswait_for_late_metadatato collect updates arriving after a prompt reply; returns per-turn metadata in streamed responses.trace=tracein all agent harnesses (claude-code, codex, hermes, kimi, openclaw, pi, pool, prime-agent, rlm) to enable metadata recording.MissingAcpMetawhen expected metadata is absent rather than silently scoring zero.Macroscope summarized c7a1bde.
Note
Medium Risk
Touches core ACP turn completion timing (up to ~1s grace on metadata-less turns) and rollout trace shape; harness wiring is broad but mostly additive opt-in via
trace.Overview
Rollout traces now accumulate ordered, namespaced ACP extension metadata from
SessionInfoUpdate.field_meta, exposed astrace.info["acp_meta"]via_record_acp_meta(append-only per namespace, no flattening).The ACP runner captures metadata into session-wide and per-turn buckets, waits for late metadata after each prompt (grace window vs. short settle so stragglers are not dropped or attributed to the wrong turn), writes
meta.jsonon one-shot runs, and returns per-turnmetaon live session responses.ACP.run/_runand session prompts accepttraceand record metadata; all major ACP harnesses passtrace=trace.Prime Agent eval coverage adds shared
prime_agent_meta_guards(raiseMissingAcpMetawhen required_metais missing), fixture tasksets, unit tests, and Docker e2e tests for subagents, autonomous gates, harness state, and killed-child failures.Reviewed by Cursor Bugbot for commit c7a1bde. Bugbot is set up for automated code reviews on this repo. Configure here.