Skip to content

Takeda PA copilot on Vanguard

Status: Current | Last reviewed: 2026-09-30

This isolated demo implements the two provided mockups using the existing config.copilot runtime. Source is under scripts/takeda-pa-copilot/ on takeda-demo-build-copilot. The feature branch is based on origin/vanguard; the deployed Vanguard installation runs the newer environment/vanguard runtime. Deployment publishes catalog/agent resources into that runtime rather than replacing its application checkout.

Resources and behavior

The TrueServe tenant owns Takeda Demo Build Copilot and the dedicated Takeda PA Copilot catalog (takeda-pa-copilot, type agent_assist). One Takeda PA coaching worker uses the environment's active OpenAI integration, gpt-4.1-mini, temperature 0, both speaker channels, and a 0.5-second debounce. Deepgram Nova-3 provides the configured speech transcription stage. The worker references TakedaCoachingCard with a strict phase (none, policy, records) and evidence schema. This is the single component selected in the editor; it renders the appropriate reusable view internally.

Component Trigger Content source
PayerPolicyAlert Renee's delayed prior authorization is discussed by either speaker Supplied synthetic policy/record fixture, compiled into the component
RecordsChecklist Either speaker affirmatively pulls up/checks the records Three fixed checklist fields from the supplied mockup

A Root component wraps the single coaching card. A none phase or missing evidence renders no content. Explicit patient changes are supported clear-state updates with an exact transcript quote, so earlier case content cannot remain selected merely because it is still in history. The stable surface ID copilot-takeda-pa-coaching updates in place, so both views share one canvas node and one rail card. An affirmative records cue ends the policy-alert phase and replaces it with the checklist, keeping the next component visible in a narrow rail; an explicit request to review payer criteria can restore the policy card. Prompts treat transcript text as untrusted data, exclude negated actions and unrelated patients, and reset case-specific state on an explicit patient switch. Classification is model-based, so new phrasing should be acceptance-tested. The 40-utterance context window bounds retained trigger context; long-call state persistence is outside this initial demo.

Policy facts are never generated by the classifier. “Start Appeal” and “View Payer Bulletin” expand local demo details; neither performs a clinical, payer, or CRM write. The checklist does not extract or persist form values. An isolated Takeda PA Demo surface configuration supplies the navy/green reference palette without changing tenant-wide branding. Each renderer includes .tsf-catalog-takeda-pa-copilot, matching catalog-builder’s stylesheet scope. The catalog uses host CSS variables, includes strict schemas, preview samples, and matching declarative tool manifests.

Provision

Run inside Vanguard's devcontainer from its repository root, with this source copied to an isolated location. The script refuses other public hostnames and non-loopback database hosts.

bash .devcontainer/scripts/with-env.sh apps/ai-orchestrator/.venv/bin/python scripts/takeda-pa-copilot/provision.py

Provisioning resolves active integration IDs from Vanguard, creates or updates only the named demo resources, copies source into the isolated catalog workspace, and invokes catalog-builder's normal publish endpoint. It saves the agent through Studio, validates agent_id:draft, publishes, and verifies published preflight. Temporary scoped API credentials expire in one hour and are revoked in finally. It does not change existing agents, phone routing, shared catalogs, or application services. A prior configuration snapshot and verification report are written under .local-data/takeda-pa-copilot/.

Rerunning publishes new catalog/agent versions. Inspect agent.json and preflight.json after execution; a failed preflight is not a successful deployment. To roll back, republish the previous configuration through Studio and select the earlier catalog version. Never reset the shared runtime checkout to this older branch.

Acceptance

Start the replay host with the same environment loader, using the ai-manager tsx loader, then run browser-test.ts:

export TSX_TSCONFIG_PATH="$PWD/apps/ai-manager/tsconfig.json"
bash .devcontainer/scripts/with-env.sh node --import ./apps/ai-manager/node_modules/tsx/dist/loader.mjs scripts/takeda-pa-copilot/replay-host.ts
node --import ./apps/ai-manager/node_modules/tsx/dist/loader.mjs scripts/takeda-pa-copilot/browser-test.ts

For an automatically cleaned-up test run, use bash scripts/takeda-pa-copilot/acceptance.sh.

The host binds only 127.0.0.1:3017, checks Host/Origin, scopes requests to sessions it created, keeps credentials server-side, and revokes its temporary credential on SIGINT/SIGTERM. Surface App is on port 3002. The embed uses railOnly=true and hideInput=false: this permits the local detail buttons; hideInput=true makes ordinary copilot card controls read-only. The interactive replay also retains Surface App’s text composer. Stop gracefully after tests so active conversations close.

The browser suite exercises real conversation-api session creation, finalized transcript submission, model inference, SSE, embed JWT exchange, published bundle loading, and Surface App rendering. It covers the supplied opening and records cues, both speakers, negative cues, unrelated patients, explicit patient changes, stable card counts, new sessions, and local action buttons. Screenshots, sanitized event payloads, and results live under .local-data/takeda-pa-copilot/; do not save signed iframe URLs or credentials.

The tests replay finalized text. Phone audio transport and external CRM embedding are not part of this first component-development phase.

See the operator guide.

Verified Vanguard deployment

On 2026-09-30, agent 4461:v7, catalog 941cf0ec-b983-480a-b5e9-5a4f9abb8467 version 1.0.7 (ready), and surface configuration bb238a6d-4601-4a9a-a8d3-85b000efdbda were verified. Published preflight returned no errors or warnings. All ten live Chromium acceptance checks passed with no page/API errors, including computed style assertions for card borders, grid layout, navy text, and green actions. Temporary provisioning and acceptance credentials were revoked (zero active tokens after cleanup).

The deployed source is retained at .local-data/takeda-pa-source/ on Vanguard, separate from its shared application checkout. The editable catalog source is in .local-data/catalog-workspaces/catalog-tenant-trueserve-takeda-pa-copilot/. Test evidence is in .local-data/takeda-pa-copilot/ (result.json, events.json, 01-policy.png, 02-records.png).

Genesys mapping permissions

The Genesys mapping GET response now includes can_edit and edit_restriction, derived from integration scope and the authenticated platform-admin claim. The dialog stays read-only until the server confirms edit permission. For platform-owned integrations, tenant users see the restriction before editing; Save and form controls are disabled. A 403 received after permission changes displays inline and returns the dialog to read-only, without logging an expected denial as a Next.js console error. Existing PUT/DELETE authorization checks remain unchanged.

Publishing an agent's CCaaS availability and changing a platform integration's routing are separate actions. The Takeda provisioner omits ccaasIntegrationIds on subsequent publication to preserve existing availability. It does not grant platform-admin access or alter Genesys routes.

Run node scripts/takeda-pa-copilot/mapping-modal-test.mjs for isolated browser regressions covering read-only, editable and revoked-permission states. A separate live tenant-scoped GET check verifies Vanguard returns the read-only metadata for its platform integration.