Skip to content

fix(openclaw): preserve compaction evidence - #6058

Closed
giuliolovisotto wants to merge 3 commits into
glovisotto/conformance-unsupported-compactionfrom
glovisotto/openclaw-compaction
Closed

giuliolovisotto wants to merge 3 commits into
glovisotto/conformance-unsupported-compactionfrom
glovisotto/openclaw-compaction

Conversation

@giuliolovisotto

@giuliolovisotto giuliolovisotto commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

OpenClaw's saved compaction event did not identify its helper model call, so the helper could become a policy turn and its usage was omitted from the response. Reconcile session-owned captured calls with the saved summary, and derive the automatic trigger from completed runtime evidence. Ambiguous matches retain an explicit gap.

Add a deterministic compaction schedule: fourteen shell steps create eligible history, a scripted context-overflow error triggers recovery, and the agent summarizes and resumes. Pi and OpenClaw reuse the same overflow-response probe. This exercises overflow recovery rather than claiming to measure a natural context threshold.

The compaction checker now handles recovered HTTP errors without requiring a provider response ID. The existing shared P0 checks enforce complete failed exchanges and preserve unknown token counts, and the P1 scenario also requires those P0 checks to pass; aggregate usage is the measured subtotal with an explicit gap. Successful-response, summary-reuse, ownership and policy-turn requirements remain enforced.

Stacked on #6053. No separate issue: this continues that conformance-scenario stack. Production generation settings are unchanged; reported compaction ownership, policy-turn counts and aggregate usage are corrected when capture is enabled.

Validation on Linux arm64 with OpenClaw 2026.6.11 and Node 22.19.0:

  • python -m scripts.run_harness_conformance --harness openclaw --gate-tier P1 --timeout 300 --output /tmp/conformance-results/openclaw-all-final: all eight P0 scenarios and the P1 compaction scenario fulfilled, with no issues.
  • Compaction rollout: 17 model attempts, 14 tool executions, one summary, 15 policy turns; measured usage 7,600 input / 131 output tokens. The rejected attempt retains unknown usage and the aggregate carries a gap.
  • python -m pytest responses_api_agents/openclaw_agent/tests scripts/harness_conformance/tests tests/unit_tests/rollouts/harness_capabilities/test_compaction.py -q -o log_cli=false: 782 passed, 11 skipped.
  • pre-commit run --all-files: passed.

Follow-up validation after removing the duplicate error comparison:

  • Re-inspected the saved compaction rollout: fulfilled. Removing the captured error or fabricating zero usage fails the existing shared checks and the scenario verdict.
  • Compaction, shared behavior and runner unit tests: 214 passed; one pre-existing failure in test_auxiliary_calls_are_required_in_canonical_exchange_comparison, reproduced using the unchanged test from the previous head. That test still expects the removed auxiliary-call mechanism.
  • pre-commit run --all-files: passed.

@giuliolovisotto giuliolovisotto added bug Something isn't working area:agent Agent harnesses and Responses API agent behavior labels Nov 12, 2026
@copy-pr-bot

copy-pr-bot Bot commented Nov 12, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@giuliolovisotto
giuliolovisotto marked this pull request as ready for review November 12, 2026 16:31
@nemo-automation-bot
nemo-automation-bot Bot requested review from a team November 12, 2026 16:32
@giuliolovisotto
giuliolovisotto force-pushed the glovisotto/openclaw-compaction branch from 8725c21 to 7d11266 Compare November 12, 2026 16:42
@giuliolovisotto
giuliolovisotto force-pushed the glovisotto/conformance-unsupported-compaction branch from 6689064 to 24ed6e6 Compare November 12, 2026 16:42
@giuliolovisotto
giuliolovisotto force-pushed the glovisotto/conformance-unsupported-compaction branch from 24ed6e6 to 6a9b89c Compare November 12, 2026 17:02
@giuliolovisotto
giuliolovisotto force-pushed the glovisotto/openclaw-compaction branch from 7d11266 to 86ee7e5 Compare November 12, 2026 17:02
@giuliolovisotto
giuliolovisotto force-pushed the glovisotto/conformance-unsupported-compaction branch from 6a9b89c to 19daf3f Compare November 13, 2026 10:15
@giuliolovisotto
giuliolovisotto force-pushed the glovisotto/openclaw-compaction branch from 86ee7e5 to 0e83f1c Compare November 13, 2026 10:15
@giuliolovisotto
giuliolovisotto removed this pull request from stack #6062 November 13, 2026 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:agent Agent harnesses and Responses API agent behavior bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant