Skip to content

fix(a2a): export real cleanup state instead of unavailable placeholder - #209

Open
ruanzhengxin-zhuxing wants to merge 1 commit into
mainfrom
harness/ced39a2e
Open

fix(a2a): export real cleanup state instead of unavailable placeholder#209
ruanzhengxin-zhuxing wants to merge 1 commit into
mainfrom
harness/ced39a2e

Conversation

@ruanzhengxin-zhuxing

Copy link
Copy Markdown
Collaborator

Why

pipeline_snapshot.cleanup.statusMessage always showed the static placeholder Cleanup state unavailable. Inspect the session file and cloud resources manually. and cleanup.history[].status was recorded as unavailable, so cleanup outcomes were not auditable (evidence sessions b16facddf1324814bdf2e13d1ecedf8b etc., 2026-07-14).

Root cause

The A2A cleanup exporters (_pipeline_cleanup_handoff_data_from_ledger / _pipeline_cleanup_handoff_data_from_session in a2a/pipeline_executor.py, _cleanup_payload_from_private_ledger_or_unavailable in a2a/executor.py) only distinguished "has a pending cleanup prompt" from "no prompt". Every other path either emitted the placeholder payload or dropped data.cleanup entirely, so the snapshot reducer kept stale/placeholder state.

What changed

  • pipeline/engine/cleanup.py: new CleanupLedger.build_state_summary() + CleanupStateSummary deriving an auditable aggregate status (skipped / completed / partial / failed / pending / in_progress) with a human-readable, translatable status message; cleanup_state_unavailable_message() carries the actual reason (ledger_missing / load_failed + load error).
  • a2a/pipeline_executor.py / a2a/executor.py: exporters now publish the real cleanup state in pipeline_handoff_ready.data.cleanup (with skipped: true when nothing needed cleanup); unavailable is reserved for a genuinely missing/unreadable ledger and includes unavailableReason.
  • Removed the old placeholder string; updated messages catalogs for zh/es/fr/de/ja/pt.
  • Tests: new/updated cases in tests/a2a/test_executor_cleanup.py, tests/a2a/test_pipeline_executor.py, tests/a2a/test_pipeline_snapshot.py asserting statusMessage no longer contains unavailable for real states and cleanup.history[].status reflects the ledger.

Verification

  • tests/a2a + tests/pipeline + tests/i18n + tests/test_i18n.py: 3034 passed
  • tests/web + tests/services: 2132 passed, 2 skipped
  • ruff check / ty check: pass
  • Only deselected test tests/pipeline/engine/test_prerequisites.py::test_prepare_direct_binary_installer_reports_invalid_http_url_without_leaking_token also fails on the unmodified baseline (sandbox proxy changes the HTTPError text) — unrelated.

Harness WorkItem: ced39a2e-3a62-4d8c-87ad-0b2c13c60803

pipeline_snapshot.cleanup.statusMessage always fell back to the static
"Cleanup state unavailable" text and cleanup.history[].status was written
as unavailable, so cleanup outcomes were not auditable.

The A2A cleanup exporters only distinguished "has a pending cleanup
prompt" from "no prompt": every other path either emitted the placeholder
or dropped the cleanup payload entirely, leaving stale/placeholder state
in the snapshot.

Derive an auditable cleanup summary from the ledger (skipped / completed /
partial / failed / pending / in progress) and publish it verbatim in the
pipeline_handoff_ready payload. "unavailable" is now reserved for a ledger
that is genuinely missing or unreadable, and carries a reason instead of a
generic instruction to inspect things manually.
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