Skip to content

Port onOptionsLoad handler for dynamic select dropdown population #50

@patrick-chinchill

Description

@patrick-chinchill

Upstream feature missing in Python SDK.

What's missing

Upstream Vercel Chat TS exposes onOptionsLoad() for registering handlers that dynamically populate Select / RadioSelect dropdown options when a user opens a modal — returning { value, label }[] live from the handler.

Upstream references

  • vercel-chat/packages/chat/src/types.ts:655processOptionsLoad method on ChatInstance
  • vercel-chat/packages/chat/src/chat.ts:610-629onOptionsLoad() decorator with action-ID matching
  • vercel-chat/packages/chat/src/chat.ts:911processOptionsLoad dispatch
  • Types: OptionsLoadEvent, OptionsLoadHandler, OptionsLoadPattern

What we need to port

  1. Types: OptionsLoadEvent, OptionsLoadHandler in src/chat_sdk/types.py
  2. Chat.on_options_load() decorator with action-ID matching (explicit matches first, then catch-all)
  3. Chat.process_options_load() entry point for adapters
  4. ChatInstance protocol: add process_options_load method
  5. Adapter integration: Slack, Teams dispatch options_load events when the platform requests option population

Impact

  • Required for modals that need server-side dynamic dropdowns (e.g., "pick from my Jira projects", "pick from my Linear issues")
  • chinchill-api doesn't currently use it, so not blocking

Acceptance

  • Types + handler registration + dispatch
  • Slack adapter emits events when block_suggestion payload arrives
  • Teams adapter emits events when config/fetch arrives
  • Integration tests on recorded fixtures
  • Entry in docs/UPSTREAM_SYNC.md non-parity table cleared

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions