Repository navigation
fix(validate): report the env writer's progress on the event loop, which a Temporal heartbeat needs - #335
Merged
Conversation
…ich a Temporal heartbeat needs Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Collaborator
Author
|
End to end, through the hub worker's real activity. I ran prod's worker image (018ae5b445) as uid 65532 against dev, with the worker's own
The containers, the images and the temporary credentials are deleted. |
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. Since #325,
A2AAgent.validate()writes the example env in a thread (asyncio.to_thread) and callson_progressfrom that thread. The hub worker'son_progresssends a Temporal activity heartbeat, which only works on the activity's event loop. So every hub validation now fails at its first progress line withRuntimeError: no running event loop. That started when the worker took 0.9.1357. A validation ofclaude-code-cliin prod failed this way on both attempts and wrote nothing.Change. The writer's progress lines go through
loop.call_soon_threadsafe, soon_progressruns on the validator's event loop like every other line. It also keeps the caller's context, which the heartbeat needs to find its activity. The lines arrive before the write'sawaitreturns, since the thread schedules them before its result.Test. A new unit test checks that the writer's line reaches the callback on the event loop with the caller's context variables. On main it fails with the same
RuntimeError: no running event loop; with this change it passes. The CLI and A2A agent unit tests pass (625).Labelled
bump-version, so merging it cuts the release that fixes hub validations once the worker pins it.🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge.Summary
Writer progress now reaches
on_progresson the validator’s event loop.Diagram
sequenceDiagram participant V as Validator event loop participant W as Writer thread participant P as Progress callback V->>W: asyncio.to_thread(write_validation_env) W->>V: call_soon_threadsafe(report, line) V->>P: Report progress with copied caller context W-->>V: Writer completes V->>V: Await _runReviews (1) · Last reviewed commit: "fix(validate): report the env writer's p..." · Reviewed by Greptile