fix(a2a): export real cleanup state instead of unavailable placeholder - #209
Open
ruanzhengxin-zhuxing wants to merge 1 commit into
Open
fix(a2a): export real cleanup state instead of unavailable placeholder#209ruanzhengxin-zhuxing wants to merge 1 commit into
ruanzhengxin-zhuxing wants to merge 1 commit into
Conversation
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.
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.
Why
pipeline_snapshot.cleanup.statusMessagealways showed the static placeholderCleanup state unavailable. Inspect the session file and cloud resources manually.andcleanup.history[].statuswas recorded asunavailable, 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_sessionina2a/pipeline_executor.py,_cleanup_payload_from_private_ledger_or_unavailableina2a/executor.py) only distinguished "has a pending cleanup prompt" from "no prompt". Every other path either emitted the placeholder payload or droppeddata.cleanupentirely, so the snapshot reducer kept stale/placeholder state.What changed
pipeline/engine/cleanup.py: newCleanupLedger.build_state_summary()+CleanupStateSummaryderiving 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 inpipeline_handoff_ready.data.cleanup(withskipped: truewhen nothing needed cleanup);unavailableis reserved for a genuinely missing/unreadable ledger and includesunavailableReason.messagescatalogs for zh/es/fr/de/ja/pt.tests/a2a/test_executor_cleanup.py,tests/a2a/test_pipeline_executor.py,tests/a2a/test_pipeline_snapshot.pyassertingstatusMessageno longer containsunavailablefor real states andcleanup.history[].statusreflects the ledger.Verification
tests/a2a + tests/pipeline + tests/i18n + tests/test_i18n.py: 3034 passedtests/web + tests/services: 2132 passed, 2 skippedruff check/ty check: passtests/pipeline/engine/test_prerequisites.py::test_prepare_direct_binary_installer_reports_invalid_http_url_without_leaking_tokenalso fails on the unmodified baseline (sandbox proxy changes the HTTPError text) — unrelated.Harness WorkItem: ced39a2e-3a62-4d8c-87ad-0b2c13c60803