Add periodic A2A worker progress updates - #105
Merged
Merged
Conversation
dimavrem22
force-pushed
the
feat/a2a-progress-updates
branch
from
August 15, 2026 04:12
2b159ee to
ada542b
Compare
dimavrem22
force-pushed
the
feat/a2a-progress-updates
branch
from
August 15, 2026 04:45
ada542b to
adb4b99
Compare
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.
Executive Summary
This PR gives inbound A2A requesters an immediate cadence-aware acknowledgment followed by concise progress updates while Hermes is working.
Description
Every created or message admission first verifies the exact authoritative task, context, active state, and latest caller-role message. The durable payload is rebuilt from the authoritative message parts and task caller metadata, so webhook-supplied caller IDs, organization IDs, handles, and text cannot reach the receipt, registry, or model turn. Inbound A2A admission then sends a nonterminal receipt after durable context binding and before model work begins. While Hermes processes the task, a referenced background task emits short progress replies every 180 seconds by default. The interval is configurable through
platforms.inkbox.a2a_progress_interval_secondsorINKBOX_A2A_PROGRESS_INTERVAL_SECONDS;0disables periodic updates.The auxiliary writer receives requester text and up to eight normalized tool names from tool-start hooks. It never receives tool arguments, results, or model reasoning, and generated prose that repeats an identifier is rejected. Candidate updates are persisted before delivery, matched only against exact agent-role history, and retried after five seconds when active delivery fails. Cadence and pending delivery survive restart and caller follow-up.
Explicit completion, input, and failure tools persist a message-owned fence before their side effect and drain an in-flight update before replying. Stop, cancellation, and shutdown close A2A admission before draining active delivery and work. Once closing starts, every A2A event—including cancellation and sent-task updates—receives a retryable 503 before it can mutate state or wake a session. Catch-up enumerates both exact active states, deduplicates task IDs, applies authoritative admission, reuses durable caller input, treats input-required and authentication-required tasks as settled, never mistakes worker history for new work, and rejects replay of the same outcome-fenced caller message before enqueue. Cancellation reconstructs missing message IDs from durable and authoritative state, tombstones only that generation, and permits one distinct authoritative active caller follow-up.
Reason
A requester should be able to distinguish queued, actively running, and finished worker tasks without treating a long silent period as a failed handoff. Neither stale nor spoofed webhook data may choose the caller identity, organization, text, or work generation used by Hermes. Restart recovery must also discover work that has already advanced from submitted to working.
Decisions
submittedandworkingstates, deduplicate by task ID, and pass every candidate through authoritative admission.agentorROLE_AGENThistory confirms delivery, and uncertain active delivery retries after five seconds.Testing
.venv/bin/python -m pytest -q— 602 passed, 25 skipped..venv/bin/python -m pytest -q tests/test_a2a.py— 78 passed.python3.11 -m pytest -q tests/test_a2a.py— 78 passed..venv/bin/ruff check .— passed..venv/bin/python -m compileall -q .— passed.git diff --check— passed.4 + 6 = 10.