fix(agent): Make Ctrl+C actually work: Do not use context.TODO - #225
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
indradhanush
force-pushed
the
dg/context-todo-agent
branch
4 times, most recently
from
August 20, 2026 21:07
4ba2185 to
5bf5ac2
Compare
sebastian-pf9
approved these changes
Aug 21, 2026
indradhanush
force-pushed
the
dg/context-todo-agent
branch
from
August 21, 2026 10:36
5bf5ac2 to
cbe7e1c
Compare
The host reconciler was registered with context.TODO() while the manager ran on the signal context. Its event filter therefore held a context that no signal could cancel. Build the signal context once and use it for both. Manager construction and reconciler registration move out of main() so a test can reach them, which nothing could before. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Every command the executor ran got a fresh context.TODO, so cancelling a reconcile left those commands running with nothing able to stop them. The reconciler's call site moves in this commit rather than its own. It is the only caller, and the package would not build split across two. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
indradhanush
force-pushed
the
dg/context-todo-agent
branch
from
August 21, 2026 11:36
cbe7e1c to
63a6ad5
Compare
One package-level context.TODO was shared by every spec, so the API calls a spec made outlived it. A spec left behind referred to a ctx that no longer existed, which broke the build for the whole package. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Registration made its own context.TODO. The CSR wait rooted its approval timeout on a second one. Neither could be cancelled when the agent shut down. The signal context now reaches both, threaded through the bootstrap and rotation helpers in main(). The agent suite moves onto Ginkgo's SpecContext here rather than separately, because its specs call the helpers whose signatures change. Two constraints shaped that. Docker calls made through the host runner span a spec and its AfterEach, so they take a suite-scoped context that Ginkgo will not cancel when a node body returns. Gomega drops its default Eventually timeout as soon as an assertion carries a context, so that default is pinned back on. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
indradhanush
force-pushed
the
dg/context-todo-agent
branch
from
August 21, 2026 12:12
63a6ad5 to
72bd890
Compare
Collaborator
Author
|
Changelog: Fix bad merge conflict. No code changes. |
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.
Same motivation as #222. But targeted for the agent. The agent now propagates a ctx down into the controllers and everything else. So a clean exit is to be expected.
Also similar to #222, refactor main so that we can unit test it.
Note to reviewers
Reviewing one commit at a time will make it easier to absorb the changes.