Skip to content

fix: select wake response aliases by name - #21

Merged
RMANOV merged 1 commit into
mainfrom
fix/pr19-response-alias-names-20261012
Oct 12, 2026
Merged

RMANOV merged 1 commit into
mainfrom
fix/pr19-response-alias-names-20261012

Conversation

@RMANOV

@RMANOV RMANOV commented Oct 12, 2026

Copy link
Copy Markdown
Owner

The response-alias fallback relied on tool_response occupying the first tuple position. Select aliases by name so future reordering of _HOOK_RESPONSE_KEYS preserves all supported aliases and explicitly excludes the separately handled canonical key.

This addresses the optional maintainability comment on PR #19. The change is confined to hooks/debate_wake.py.

Validation: the existing payload-normalization and wake-regression suites pass (51 tests), repository Ruff checks pass, and git diff --check passes. GitHub CI will validate the full suite on Python 3.11.

Copilot AI balanced review requested due to automatic review settings October 12, 2026 17:38
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-12T17:39:12.913148Z bf3db7b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The change is a minimal, behavior-preserving refactor that correctly removes a positional assumption, with no other code depending on that ordering.

0 open findings

What changed in this PR

This PR hardens the wake-hook response alias selection in hooks/debate_wake.py. Previously, _extract_tool_response built its alias list using the positional slice _HOOK_RESPONSE_KEYS[1:], which implicitly assumed the canonical "tool_response" key always occupies index 0. The change replaces that positional assumption with an explicit name-based exclusion (key != "tool_response"), so any future reordering of _HOOK_RESPONSE_KEYS still correctly includes all aliases while excluding the separately handled canonical key. This addresses an optional maintainability comment from PR #19.

Changes:

  • Replace the fragile positional slice _HOOK_RESPONSE_KEYS[1:] with an explicit, name-based filter that excludes "tool_response".
  • Preserve existing behavior: canonical tool_response is still handled first, and remaining aliases are normalized via _normalize_tool_response.
File Description
hooks/​debate_wake.py Selects response aliases by name rather than by tuple position, removing an implicit ordering dependency in _extract_tool_response.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@RMANOV
RMANOV merged commit d1d304b into main Oct 12, 2026
3 checks passed
@RMANOV
RMANOV deleted the fix/pr19-response-alias-names-20261012 branch October 12, 2026 17:44
RMANOV added a commit that referenced this pull request Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants