Skip to content

feat(config): make phone_number optional for non-voice/SMS deployments (AA-1398) - #137

Open
wenzhu1587 wants to merge 2 commits into
mainfrom
feat/AA-1398-optional-phone-number
Open

wenzhu1587 wants to merge 2 commits into
mainfrom
feat/AA-1398-optional-phone-number

Conversation

@wenzhu1587

@wenzhu1587 wenzhu1587 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Resolves AA-1398: TACConfig no longer requires phone_number / phone_numbers; they are required only by the Voice and SMS channels.

The requirement moves from the config to the channels that actually use a phone number:

  • Config: the phone_number pair is now optional, the same as the RCS and WhatsApp pairs.
  • VoiceChannel: raises ValueError at construction when no phone number is configured, matching the existing SMSChannel guard.
  • Chat handoff: Studio handoff from Chat sends From the configured phone number. Without one, it now returns handoff_failed with a clear error instead of posting a Studio execution with no From.
  • Docs: getting_started/README.md and .env.example list the phone number under "Required for Voice and SMS channels".

Behavior change: a config with no phone number used to fail at TACConfig validation. It now fails at VoiceChannel / SMSChannel construction, with a message naming the env vars. The library never constructs these channels implicitly (including TACFastAPIServer), so apps that don't use them are unaffected.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Refactoring
  • Release / version bump

Checklist

  • Tests added/updated
  • Documentation updated
  • Tested E2E

New tests cover:

  • config and from_env() accepting no phone number
  • Voice and SMS rejecting a missing one
  • RCS constructing without one
  • Chat handoff failing cleanly

make check passes (1087 tests).

SDK Parity

This is the Python SDK. If this change affects shared functionality, ensure the TypeScript SDK is updated as well.

  • Change is Python-specific (no TypeScript update needed)
  • TypeScript SDK PR created: not yet. The TS SDK has the same "at least one of phoneNumber / phoneNumbers" requirement (packages/core/src/types/config.ts), so it needs a follow-up.

🤖 Generated with Claude Code

…s (AA-1398)

TACConfig no longer requires phone_number/phone_numbers, so RCS, WhatsApp,
and Chat-only deployments can omit them. The requirement moves to the
channels that actually use a phone number:

- VoiceChannel now raises at construction without phone_number(s),
  matching the existing SMSChannel guard.
- Chat handoff (which sends From the configured phone number) returns
  handoff_failed instead of posting a Studio execution with no From.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 15, 2026 21:49

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.

🟡 Changes recommended

Missing-sender Chat handoff disables conversation routing before returning failure, leaving no receiving system to take over.

1 open finding
What changed in this PR

Makes phone numbers optional in TAC configuration for RCS-, WhatsApp-, and Chat-only deployments, moving enforcement to channels that need them.

Changes:

  • Adds Voice construction validation and missing-sender Chat handoff handling.
  • Updates configuration and channel regression tests.
  • Revises setup documentation and the voice provider comment.
File Description
tests/​test_voice_channel.py Tests missing-number rejection.
tests/​test_sms_channel.py Tests validation at channel construction.
tests/​test_rcs_channel.py Tests construction without a phone number.
tests/​test_handoff.py Tests missing-number Chat handoff failure.
tests/​test_config.py Tests optional phone configuration.
tests/​test_config_from_env.py Tests omitted phone environment variables.
src/​tac/​tools/​handoff.py Rejects missing Studio senders.
src/​tac/​core/​config.py Makes phone numbers optional.
src/​tac/​channels/​voice/​conversation_relay/​provider.py Updates validation explanatory comment.
src/​tac/​channels/​voice/​channel.py Requires configured phone numbers.
getting_started/​README.md Clarifies channel-specific requirements.
getting_started/​examples/​.env.example Labels Voice/SMS phone requirements.

🧠 Review effort: Balanced


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

Comment thread src/tac/tools/handoff.py
Comment on lines +210 to +211
if from_address is None:
error = "No Studio `From` sender: Chat handoff requires phone_number in TACConfig."
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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