ParticipantResponse.name is required where the API definition marks it nullable, so a nameless participant fails to parse

Aperta Adatta ai principianti
#134 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 5 giorni

@TheeCoderAhmed ci sta già lavorando.

Dal 29/10/2026.

  • #147 di @TheeCoderAhmed — aperta

Valutazione

Difficoltà
1/5
Tempo stimato
Meno di un'ora
Idoneità per principianti
86/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
api

Direzione di ricerca

Leggi src/tac/models/conversation.py e la dichiarazione di ParticipantResponse intorno alle righe 237–243; confronta il suo campo name con la definizione nullable e facoltativa citata nell’issue. Controlla i percorsi di costruzione dei participants in src/tac/context/conversation.py ed esegui i test pertinenti del model o del context. Il lavoro è completato quando le responses senza name o con valore null vengono analizzate correttamente, mentre gli altri campi obbligatori restano obbligatori.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

What differs

ParticipantResponse.name is a required, non-nullable str, where the canonical definition marks the field nullable and does not require it. A participant with no display name therefore raises ValidationError client-side on a response the API is entitled to send.

Verified against main today (2026-10-08) at 2c24bd988c. All line citations are for navigation only.

# src/tac/models/conversation.py:237-243
class ParticipantResponse(BaseModel):
    id: str = Field(..., description="Participant ID")
    conversation_id: str = Field(..., alias="conversationId", description="Conversation ID")
    account_id: str = Field(..., alias="accountId", description="Account ID")
    name: str = Field(..., description="Participant display name")

What the definition declares

twilio/twilio-oai spec/yaml/twilio_conversations_v2.yaml, schema conversations.v2.participant at 141f1201b5 (:422-445):

  • required: is id, conversationId, accountId — name is not in it
  • name is type: string with nullable: true

The other three required fields match the model exactly, so name is the only divergence in this class.

Consequence

create_participant, update_participant and list_participants all construct ParticipantResponse(**...) (src/tac/context/conversation.py:140, :204, :228). Any participant the service returns without a name — or with "name": null, which nullable: true permits — makes all three raise, so the caller cannot read a conversation's participants rather than reading them with name=None.

What the model should declare

name: str | None = Field(None, description="Participant display name"), matching the treatment profile_id, created_at and updated_at already get in the same class.

The TypeScript port has a milder instance of the same thing

Not a separate report, since the two SDKs track each other — twilio/twilio-agent-connect-typescript at c34450aa8c, packages/core/src/types/conversation.ts:316:

export const ConversationParticipantSchema = z.object({
  ...
  name: z.string().optional(),      // :316 — accepts missing, rejects null

.optional() admits undefined but not null, so an explicit "name": null fails ListParticipantsResponseSchema.parse. The same file already uses the right shape twice for exactly this reason, with the reason in the comment — :281 name: z.string().nullish(), // API returns null when not set and :304 channelId: z.string().nullish(), // API returns null when not set. .nullish() at :316 would make it consistent.

Context, and no urgency implied

Found while building an OpenAPI-driven client generator against the canonical twilio-oai specs and comparing its output with the hand-written SDKs. We are not blocked — nothing here needs a response on any timeline.

Lingua principale
Python
Stelle
17
Fork
11
Merge medio
5g 19h
PR unite (30g)
6

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di twilio/twilio-agent-connect-python

Tutte le issue di twilio/twilio-agent-connect-python

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.