Skip to content

feat: migrate conversations list to v3 API (DEVP-664) - #306

Open
andymohajeri wants to merge 1 commit into
mainfrom
andym/DEVP-664/deprecate-v1-conversations-api-usage-and-move-to-v3
Open

feat: migrate conversations list to v3 API (DEVP-664)#306
andymohajeri wants to merge 1 commit into
mainfrom
andym/DEVP-664/deprecate-v1-conversations-api-usage-and-move-to-v3

Conversation

@andymohajeri

Copy link
Copy Markdown
Contributor

Summary

Migrates poly conversations list off the deprecated v1 conversations API to v3 in the regions where v3 is live, updating CLI wiring, response handling, and output accordingly.

Motivation

The v1 conversations API is deprecated and sunsets end of August 2026. ADK's conversations integration still targeted the old endpoint surface for list and needed to move before v1 is switched off.

Closes DEVP-664

Changes

  • handlers/platform_api.py: new platform_region_to_base_url map + use_platform_api flag on get_base_url/make_request; list_conversations is now region-aware — calls the v3 URL/params in us-1/uk-1/euw-1 (the only regions with a live v3 host today), falls back to the existing v1 call in dev/staging/studio until v3 rolls out there.
  • handlers/interface.py: AgentStudioInterface.list_conversations signature updated to match (account_id, cursor, channel, in_progress).
  • cli_commands/conversations.py: added --cursor, --channel (repeatable), --in-progress/--no-in-progress to poly conversations list; threads project.account_id through.
  • output/console.py: print_conversations now reads both the v3 (snake_case) and v1-fallback (camelCase) field shapes via a small _field() helper, and drops the Summary column — the v3 list response has no summary/tags/PolyScore/note/deployment ID/direction/language field, unlike v1. Those remain available per-conversation via poly conversations get, which is unaffected by this change (different, unversioned endpoint).
  • docs/docs/reference/cli/conversations.md: documents the new flags, the regional split, and both possible --json shapes.
  • Tests updated/added in cli_test.py and platform_api_test.py for the region branching, new params, and updated response shape.

get/get-audio are intentionally untouched — confirmed at the code level (not just docs) that they're served by a different, unversioned endpoint with no v2/v3 variant to move to.

Test strategy

  • Added/updated unit tests
  • Manual CLI testing (poly <command>)
  • Tested against a live Agent Studio project
  • N/A (docs, config, or trivial change)

Full local E2E pass against a real dev-region project: list, list --json, list with the new flags, get, get --json, and get-audio (verified the downloaded file is a real WAV). v3 branch itself (us-1/uk-1/euw-1) is covered by mocked unit tests plus a dry-run confirming the exact URL/params each region resolves to; not yet run against a live v3 project.

Checklist

  • ruff check . and ruff format --check . pass
  • pytest passes (1552 passed)
  • No breaking changes to the poly CLI interface (or migration path documented) — list --json output shape changes for us-1/uk-1/euw-1 (documented in the CLI reference); get/get-audio unchanged
  • Commit messages follow conventional commits

Screenshots / Logs

Local E2E output (against a real dev project) confirms list/get/get-audio all work end to end, including the table dropping the Summary column while get retains it. Happy to paste specifics if useful.

The v1 conversations API sunsets end of August 2026. Moves `poly
conversations list` to the v3 endpoint in regions where it's live
(us-1/uk-1/euw-1); dev/staging/studio keep the v1 endpoint until v3
rolls out there. `get`/`get-audio` are unaffected - they hit a
different, unversioned endpoint that already returns this shape.

- platform_api.py: new platform_region_to_base_url map + use_platform_api
  flag, region-aware list_conversations (v3 URL/params vs v1 fallback)
- cli_commands/conversations.py: --cursor/--channel/--in-progress flags,
  threads account_id through
- console.py: print_conversations reads both v3 (snake_case) and v1
  fallback (camelCase) field names, drops the Summary column (no v3
  equivalent - still available via `poly conversations get`)
- docs + tests updated accordingly
@andymohajeri
andymohajeri requested a review from a team September 2, 2026 20:21
@andymohajeri
andymohajeri requested a review from a team as a code owner September 2, 2026 20:21
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Coverage Report

Base (main) PR Change
77.7% 77.8% +0.0% ✅

Changed file coverage

File Coverage Change
poly/output/console.py 33.1% -0.0% ⚠️
poly/handlers/platform_api.py 73.6% +1.3% ✅
poly/cli_commands/conversations.py 88.6% +0.5% ✅

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.

1 participant