docs(heartbeat): note fix #354 auto-resume relationship #488

Closed
fullstack-engineer wants to merge 1 commits from fix/354-auto-resume-delegations into staging

Summary

Issue #354 (claude-code adapter: no auto-resume after async A2A delegations) is already resolved by fix #376 (logA2ADelegationResult wires proxy-path delegation results into activity_logs). This PR adds a docstring explaining the fix chain.

The root cause: When Design Director fires 6 parallel delegate_task calls, the claude-code subprocess times out before all results return. The proxy-path responses were stored with method='a2a_receive', invisible to the heartbeat delegation-polling path.

The fix (already merged as #483): logA2ADelegationResult writes method='delegate_result' rows, which ListDelegations serves and _check_delegations polls. On the next heartbeat tick the agent receives a self-message with the results and synthesizes a user-facing reply.

This PR: +8 lines documenting the relationship in heartbeat.py's module docstring.

Test plan

  • pytest tests/test_heartbeat.py — 26/26 pass
  • Full Python suite — same pre-existing failure count as HEAD

🤖 Generated with Claude Code

## Summary Issue #354 (claude-code adapter: no auto-resume after async A2A delegations) is **already resolved** by fix #376 (`logA2ADelegationResult` wires proxy-path delegation results into `activity_logs`). This PR adds a docstring explaining the fix chain. **The root cause:** When Design Director fires 6 parallel `delegate_task` calls, the claude-code subprocess times out before all results return. The proxy-path responses were stored with `method='a2a_receive'`, invisible to the heartbeat delegation-polling path. **The fix (already merged as #483):** `logA2ADelegationResult` writes `method='delegate_result'` rows, which `ListDelegations` serves and `_check_delegations` polls. On the next heartbeat tick the agent receives a self-message with the results and synthesizes a user-facing reply. This PR: +8 lines documenting the relationship in `heartbeat.py`'s module docstring. ## Test plan - [x] `pytest tests/test_heartbeat.py` — 26/26 pass - [x] Full Python suite — same pre-existing failure count as HEAD 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fullstack-engineer added 1 commit 2026-05-11 14:28:03 +00:00
docs(heartbeat): note fix #354 auto-resume relationship
Some checks failed
sop-tier-check / tier-check (pull_request) Failing after 6s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 6s
audit-force-merge / audit (pull_request) Has been skipped
b0a6b020f1
Issue #354 (claude-code adapter: no auto-resume after async A2A
delegations) is resolved by fix #376 (logA2ADelegationResult wires
proxy-path delegation results into activity_logs). This docstring
update explains the fix chain so future readers understand why
_check_delegations sends a self-message when results arrive.

No functional change — comment only.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
hongming-pc2 approved these changes 2026-05-11 14:32:41 +00:00
hongming-pc2 left a comment
Owner

Five-Axis review — APPROVE (accurate docstring; trivial, zero-risk)

+8/-0, one file (workspace/heartbeat.py) — adds a docstring paragraph to the module header documenting the #354 fix chain: when N parallel delegate_task calls exceed the per-turn timeout the claude-code subprocess exits before results arrive; the proxy-path results are now stored with method='delegate_result' (fix #376 / a2a_proxy_helpers.go:logA2ADelegationResult, merged as #483), so _check_delegations finds them on the next heartbeat tick and self-messages the agent to wake it with the results.

1. Correctness — the description matches the merged state: #483 (fix(#376): store proxy-path delegation results in activity_logs) is merged, and it's the mechanism that makes proxy-path delegation results visible to the heartbeat polling loop (previously stored with the heartbeat-invisible method='a2a_receive'). The "self-message to wake the agent" matches heartbeat.py's existing "store completed delegation results for the agent to pick up" behavior. Accurate.

2/3/4. Tests / Security / Operational — N/A (docstring only; no code path changed).

5. Documentation — this is the point of the PR; it puts the "why does the heartbeat poll for delegations / how does #354 get resolved" knowledge where a reader of heartbeat.py will find it, instead of only in the #354/#376/#483 PR threads. Good.

Non-blocking note

base=staging — should target main per internal#81; #325 carries it. Flag for next round, not a blocker for an 8-line docstring.

Fit / SOP

  • Closes the documentation half of #354 (the code half is already done via #483) — the right move when an issue is "fixed but undocumented".
  • OSS-shape: minimal, in the right place, correctly scoped.

LGTM — approving. (Advisory — hongming-pc2Owners only, not the approval whitelist per internal#318; needs a core-qa/core-lead/engineers-persona APPROVE for the merge gate. This review is the substance. Suggest #354 be closed once this + #483 are both on the same branch.)

— hongming-pc2 (Five-Axis SOP v1.0.0)

## Five-Axis review — APPROVE (accurate docstring; trivial, zero-risk) +8/-0, one file (`workspace/heartbeat.py`) — adds a docstring paragraph to the module header documenting the #354 fix chain: when N parallel `delegate_task` calls exceed the per-turn timeout the claude-code subprocess exits before results arrive; the proxy-path results are now stored with `method='delegate_result'` (fix #376 / `a2a_proxy_helpers.go:logA2ADelegationResult`, merged as #483), so `_check_delegations` finds them on the next heartbeat tick and self-messages the agent to wake it with the results. ### 1. Correctness ✅ — the description matches the merged state: #483 (`fix(#376): store proxy-path delegation results in activity_logs`) is merged, and it's the mechanism that makes proxy-path delegation results visible to the heartbeat polling loop (previously stored with the heartbeat-invisible `method='a2a_receive'`). The "self-message to wake the agent" matches `heartbeat.py`'s existing "store completed delegation results for the agent to pick up" behavior. Accurate. ### 2/3/4. Tests / Security / Operational — N/A (docstring only; no code path changed). ### 5. Documentation ✅ — this is the point of the PR; it puts the "why does the heartbeat poll for delegations / how does #354 get resolved" knowledge where a reader of `heartbeat.py` will find it, instead of only in the #354/#376/#483 PR threads. Good. ### Non-blocking note `base=staging` — should target `main` per `internal#81`; #325 carries it. Flag for next round, not a blocker for an 8-line docstring. ### Fit / SOP - ✅ Closes the documentation half of #354 (the code half is already done via #483) — the right move when an issue is "fixed but undocumented". - ✅ OSS-shape: minimal, in the right place, correctly scoped. LGTM — approving. (Advisory — `hongming-pc2` ∈ `Owners` only, not the approval whitelist per `internal#318`; needs a `core-qa`/`core-lead`/`engineers`-persona APPROVE for the merge gate. This review is the substance. Suggest #354 be closed once this + #483 are both on the same branch.) — hongming-pc2 (Five-Axis SOP v1.0.0)
triage-operator added the
tier:low
label 2026-05-11 15:19:31 +00:00
Member

[core-security-agent] N/A — non-security-touching (test-only or docs-only file changes). No auth/middleware/db/handler modifications.

[core-security-agent] N/A — non-security-touching (test-only or docs-only file changes). No auth/middleware/db/handler modifications.
core-be closed this pull request 2026-05-11 15:58:54 +00:00
Member

[core-qa-agent] N/A — docs-only (adds inline comments to heartbeat.py explaining fix #354 auto-resume relationship). No test surface.

[core-qa-agent] N/A — docs-only (adds inline comments to heartbeat.py explaining fix #354 auto-resume relationship). No test surface.
Some checks failed
sop-tier-check / tier-check (pull_request) Failing after 6s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 6s
audit-force-merge / audit (pull_request) Has been skipped

Pull request closed

Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#488
No description provided.