Skip to content

refactor(runtime): reuse notifier pointer identity helper - #4847

Merged
dgageot merged 1 commit into
mainfrom
refactor/runtime-reuse-notifier-pointer-identity-helper-f6d417641
Nov 9, 2026
Merged

dgageot merged 1 commit into
mainfrom
refactor/runtime-reuse-notifier-pointer-identity-helper-f6d417641

Conversation

@dgageot

@dgageot dgageot commented Nov 9, 2026

Copy link
Copy Markdown
Member

Summary

Reuse pointerIdentity for plan subscriptions instead of maintaining duplicate reflection logic.

Non-pointer notifiers still bypass deduplication safely, with added tests distinguishing nil interfaces from typed-nil pointer identities.

Standalone cleanup: one commit against main; no dependency on the other cleanup PRs.

Validation

  • task --force build
  • task test
  • task --force lint
  • Single signed commit verified; patch equivalent to the original commit.

Assisted-By: OpenAI Codex
Signed-off-by: David Gageot <david.gageot@docker.com>
@dgageot
dgageot requested a review from a team as a code owner November 9, 2026 12:04
Copilot AI balanced review requested due to automatic review settings November 9, 2026 12:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are recorded for the notifier deduplication cleanup.

No open issues 🎉

What changed in this PR

This cleanup consolidates notifier deduplication in the runtime by reusing pointerIdentity for plan subscriptions, preserving the existing behavior for non-pointer notifiers.

Changes:

  • Replace the duplicate plan-notifier identity helper with pointerIdentity.
  • Add tests distinguishing nil interfaces from typed-nil pointers.
  • Clarify the helper’s comment about unsafe interface hashing.
File Description
pkg/​runtime/​toolset_events.go Clarifies the existing pointer-identity helper’s comment.
pkg/​runtime/​plan_events_test.go Adds nil-interface and typed-nil pointer identity tests.
pkg/​runtime/​loop.go Reuses pointerIdentity and removes duplicate reflection logic.

Review effort: Balanced

@aheritier aheritier added area/runtime Runtime engine, agent loop execution, tool dispatch, loop detection kind/refactor PR refactors code without behavior change labels Nov 9, 2026
@dgageot
dgageot added this pull request to the merge queue Nov 9, 2026
Merged via the queue into main with commit e69f3a5 Nov 9, 2026
29 of 31 checks passed
@dgageot
dgageot deleted the refactor/runtime-reuse-notifier-pointer-identity-helper-f6d417641 branch November 9, 2026 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/runtime Runtime engine, agent loop execution, tool dispatch, loop detection kind/refactor PR refactors code without behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants