Skip to content

feat: Add AI assistant scheduled events - #447

Open
Oliver-Zimmerman wants to merge 1 commit into
mainfrom
audit/ai-scheduled-events-20260824
Open

Oliver-Zimmerman wants to merge 1 commit into
mainfrom
audit/ai-scheduled-events-20260824

Conversation

@Oliver-Zimmerman

Copy link
Copy Markdown
Collaborator

Audit finding

The agent CLI did not expose the Stainless-generated ai:assistants:scheduled-events lifecycle, leaving agents unable to create, retrieve, list, or safely cancel scheduled assistant phone-call/SMS events.

Changes

  • add create/get/list/cancel wrappers mapped to generated create, retrieve, list, and delete actions
  • forward the useful scalar, JSON-object, nested call-settings, retry, date-filter, channel, and pagination flags
  • validate required assistant/event IDs, channels, JSON objects, ISO 8601 date-times, and integer inputs before dispatch
  • preserve stable JSON and human-readable outputs; use raw list envelopes
  • require a bare local --confirm for cancel/delete and never forward it
  • wire command routing, help, known flags, and capabilities
  • add mock-binary JSONL coverage using JSON.stringify(args) + "\n" with an actual newline

Validation

  • npm install — passed (17 packages audited, 0 vulnerabilities)
  • npm run typecheck — passed
  • TELNYX_API_KEY='' npx tsx --test tests/ai-assistant-scheduled-events.test.ts — 6 passed, 0 failed
  • TELNYX_API_KEY='' npx tsx --test tests/ai-assistant-scheduled-events.test.ts tests/ai-assistants.test.ts — 23 passed, 0 failed
  • TELNYX_API_KEY='' npx tsx --test tests/bugfixes.test.ts — 39 passed, 0 failed
  • TELNYX_API_KEY='' npm test — 555 passed, 0 failed, 0 skipped

@Oliver-Zimmerman
Oliver-Zimmerman force-pushed the audit/ai-scheduled-events-20260824 branch from 48119d3 to 1532941 Compare August 24, 2026 09:03

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1532941a29

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +121 to +125
const response = await telnyxCli(args, { format: "raw" });
const envelope = asRecord(response);
const allEvents = dataRecords(response);
const scheduledEvents = maxItems === undefined || maxItems === -1
? allEvents

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Traverse pages before applying max-items

When an assistant has more scheduled events than one API page, this performs only a single raw request and slices that response. The raw-mode contract in cli/src/telnyx-cli.ts states that raw output is the actual REST response envelope rather than the generated CLI iterator, so requests such as --page-size 20 --max-items 50 return at most 20 events, while the advertised --max-items -1 still returns only the first page. Follow the response pagination metadata and fetch additional pages before applying the limit, or explicitly scope this option to the selected page.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant