Conversation
Related to #28885: both add Slack clarify buttons, but this implementation adds workspace/message origin binding and server-side canonical-choice resolution. Maintainer choice requested. |
|
Thanks for the Slack clarify implementation. The feature remains needed on current main: The implementation fits the existing gateway flow: The PR head is directly based on current main ( Automated hermes-sweeper review. |
Slack now overrides send_clarify to render multi-choice clarify prompts as native Block Kit buttons (one per choice + a final '✏️ Other…' free-text button), mirroring the Telegram/Discord adapters and the existing Slack approval-button pattern. - Unique hermes_clarify_choice_<idx> action_ids (Slack rejects duplicate action_ids within one actions block); dispatch via a compiled-regex action matcher plus hermes_clarify_other. - Chunks elements across actions blocks in groups of 5 so a larger choice list degrades gracefully instead of 400ing (invalid_blocks). - Choice taps resolve through tools.clarify_gateway .resolve_gateway_clarify with the canonical registered choice text — the same applier the typed-reply path uses — then edit the message to show the outcome and drop the buttons. - 'Other' flips the entry into text-capture via mark_awaiting_text (only on tap, never at send time) so the gateway text-intercept captures the next typed message. - Auth-gated via _is_interactive_user_authorized; atomic-pop double-click guard mirrors _approval_resolved; late taps on evicted entries surface an honest expiry notice instead of a false ✓. - Open-ended prompts delegate to the base plain-text render. Salvaged from PR #61943 by @100yenadmin. Earliest implementation of this feature was PR #28885 by @cypres0099; sibling implementations #66606 (@jaaro-ai) and #51547 (@Mongol-Jimmi) are superseded. Closes #52369
Slack now overrides send_clarify to render multi-choice clarify prompts as native Block Kit buttons (one per choice + a final '✏️ Other…' free-text button), mirroring the Telegram/Discord adapters and the existing Slack approval-button pattern. - Unique hermes_clarify_choice_<idx> action_ids (Slack rejects duplicate action_ids within one actions block); dispatch via a compiled-regex action matcher plus hermes_clarify_other. - Chunks elements across actions blocks in groups of 5 so a larger choice list degrades gracefully instead of 400ing (invalid_blocks). - Choice taps resolve through tools.clarify_gateway .resolve_gateway_clarify with the canonical registered choice text — the same applier the typed-reply path uses — then edit the message to show the outcome and drop the buttons. - 'Other' flips the entry into text-capture via mark_awaiting_text (only on tap, never at send time) so the gateway text-intercept captures the next typed message. - Auth-gated via _is_interactive_user_authorized; atomic-pop double-click guard mirrors _approval_resolved; late taps on evicted entries surface an honest expiry notice instead of a false ✓. - Open-ended prompts delegate to the base plain-text render. Salvaged from PR #61943 by @100yenadmin. Earliest implementation of this feature was PR #28885 by @cypres0099; sibling implementations #66606 (@jaaro-ai) and #51547 (@Mongol-Jimmi) are superseded. Closes #52369
|
Closing as superseded by #69318 (merged): rewrites clarify_gateway semantics beyond the feature scope and caps at 4 choices with text fallback; the landed base chunks beyond 5 — your fail-closed workspace binding idea is noted and worth a standalone proposal. Thanks for digging into this — the consolidated fix stands on the cluster's collective analysis, and your work is credited in #69318's summary. |
Slack now overrides send_clarify to render multi-choice clarify prompts as native Block Kit buttons (one per choice + a final '✏️ Other…' free-text button), mirroring the Telegram/Discord adapters and the existing Slack approval-button pattern. - Unique hermes_clarify_choice_<idx> action_ids (Slack rejects duplicate action_ids within one actions block); dispatch via a compiled-regex action matcher plus hermes_clarify_other. - Chunks elements across actions blocks in groups of 5 so a larger choice list degrades gracefully instead of 400ing (invalid_blocks). - Choice taps resolve through tools.clarify_gateway .resolve_gateway_clarify with the canonical registered choice text — the same applier the typed-reply path uses — then edit the message to show the outcome and drop the buttons. - 'Other' flips the entry into text-capture via mark_awaiting_text (only on tap, never at send time) so the gateway text-intercept captures the next typed message. - Auth-gated via _is_interactive_user_authorized; atomic-pop double-click guard mirrors _approval_resolved; late taps on evicted entries surface an honest expiry notice instead of a false ✓. - Open-ended prompts delegate to the base plain-text render. Salvaged from PR NousResearch#61943 by @100yenadmin. Earliest implementation of this feature was PR NousResearch#28885 by @cypres0099; sibling implementations NousResearch#66606 (@jaaro-ai) and NousResearch#51547 (@Mongol-Jimmi) are superseded. Closes NousResearch#52369
Slack now overrides send_clarify to render multi-choice clarify prompts as native Block Kit buttons (one per choice + a final '✏️ Other…' free-text button), mirroring the Telegram/Discord adapters and the existing Slack approval-button pattern. - Unique hermes_clarify_choice_<idx> action_ids (Slack rejects duplicate action_ids within one actions block); dispatch via a compiled-regex action matcher plus hermes_clarify_other. - Chunks elements across actions blocks in groups of 5 so a larger choice list degrades gracefully instead of 400ing (invalid_blocks). - Choice taps resolve through tools.clarify_gateway .resolve_gateway_clarify with the canonical registered choice text — the same applier the typed-reply path uses — then edit the message to show the outcome and drop the buttons. - 'Other' flips the entry into text-capture via mark_awaiting_text (only on tap, never at send time) so the gateway text-intercept captures the next typed message. - Auth-gated via _is_interactive_user_authorized; atomic-pop double-click guard mirrors _approval_resolved; late taps on evicted entries surface an honest expiry notice instead of a false ✓. - Open-ended prompts delegate to the base plain-text render. Salvaged from PR NousResearch#61943 by @100yenadmin. Earliest implementation of this feature was PR NousResearch#28885 by @cypres0099; sibling implementations NousResearch#66606 (@jaaro-ai) and NousResearch#51547 (@Mongol-Jimmi) are superseded. Closes NousResearch#52369
Slack now overrides send_clarify to render multi-choice clarify prompts as native Block Kit buttons (one per choice + a final '✏️ Other…' free-text button), mirroring the Telegram/Discord adapters and the existing Slack approval-button pattern. - Unique hermes_clarify_choice_<idx> action_ids (Slack rejects duplicate action_ids within one actions block); dispatch via a compiled-regex action matcher plus hermes_clarify_other. - Chunks elements across actions blocks in groups of 5 so a larger choice list degrades gracefully instead of 400ing (invalid_blocks). - Choice taps resolve through tools.clarify_gateway .resolve_gateway_clarify with the canonical registered choice text — the same applier the typed-reply path uses — then edit the message to show the outcome and drop the buttons. - 'Other' flips the entry into text-capture via mark_awaiting_text (only on tap, never at send time) so the gateway text-intercept captures the next typed message. - Auth-gated via _is_interactive_user_authorized; atomic-pop double-click guard mirrors _approval_resolved; late taps on evicted entries surface an honest expiry notice instead of a false ✓. - Open-ended prompts delegate to the base plain-text render. Salvaged from PR NousResearch#61943 by @100yenadmin. Earliest implementation of this feature was PR NousResearch#28885 by @cypres0099; sibling implementations NousResearch#66606 (@jaaro-ai) and NousResearch#51547 (@Mongol-Jimmi) are superseded. Closes NousResearch#52369
Summary
clarifychoices as native Slack Block Kit buttonschat.updatefailsSecurity
Test plan
python -m pytest -q -W error tests/gateway/test_slack_clarify_buttons.py tests/gateway/test_slack_plugin_action_handlers.py tests/tools/test_clarify_gateway.py -n 0 --tb=short— 64 passedpython -m pytest tests/gateway/test_slack*.py -q --tb=short -n 0— 464 passedpython -m pytest tests/tools/test_clarify_tool.py tests/tools/test_clarify_gateway.py tests/gateway/test_clarify_active_session_bypass.py -q --tb=short -n 0— 53 passedIndependent security review passed with no remaining concerns.