Skip to content

feat: CAS personal connections support - #620

Merged
norman-le merged 13 commits into
mainfrom
feat/cas-personal-connections
Aug 11, 2026
Merged

norman-le merged 13 commits into
mainfrom
feat/cas-personal-connections

Conversation

@norman-le

@norman-le norman-le commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

Changes Summary

Support for CAS personal connections feature: https://github.com/UiPath/AgentInterfaces/pull/1035

1. uipath-typescript (feat/cas-personal-connections)

  • New types: AvailableConnection, AvailableConnectionsItem, ConnectionSelection, UpdateConnectionSelectionsRequest, ConnectionAuthRequest/Response in src/models/conversational-agent/connections/
  • New SDK methods on ConversationalAgentService:
    • getAvailableConnections(agentId, folderId) — fetches configurable connector bindings
    • updateConnectionSelections(agentId, folderId, request) — saves user's connection picks
    • getConnectionAuthUrl(connectorKey) — internal, gets platform auth URL
    • getAddConnectionUrl(item) — public helper with fallback chain: auth URL → connectionsUrl → configurationUrl → null
  • New endpoints: CONNECTIONS, CONNECTION_AUTH
  • Docs: OAuth scopes for connections methods, added IS.Connections.Read to combined scopes
  • Sample app: 4 files demonstrating SDK usage
  • Tests: connections.test.ts — 13 tests covering all 4 methods + fallback logic + error paths

2. uipath-ui-widgets (feat/cas-personal-connections)

Blocked on uipath-typescript publish.**

  • New component: ConnectionsSection.tsx — matches CAS two-line row layout (icon+name, selection+badge+clear), inline dropdown picker, search, grouped connections, "+ Connection" button, visibility refresh
  • Modified: SettingsDialog.tsx — added agentId/folderId props, renders ConnectionsSection in accordion
  • Modified: ConversationalAgentChat.tsx — passes agentId/folderId through
  • i18n: 21 new keys in en/index.json and keys/index.json
  • Tests: ConnectionsSection.test.tsx — 17 tests covering loading, error, empty, rendering, picker, clear, dirty state, save/cancel, status badge, multiple connectors

Typescript-sdk sample app:
image

Widgets sample app:
image

image

Tests:
image

@github-actions

github-actions Bot commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-08-11 23:22 UTC

const { authUrl } = await this.getConnectionAuthUrl(item.connectorKey);
return authUrl;
} catch {
return item.connectionsUrl ?? item.configurationUrl ?? null;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

SDK falls back to connectionsUrl first, then configurationUrl.
CAS goes straight to configurationUrl.

  • ConnectionsUrl is the Orchestrator page.
  • configurationUrl is the Studio Web automation-configuration page — the URL that CAS builds in the controller

That's intentional and correct because of the use case difference:

  • CAS runs inside the UiPath platform — getConnectionAuthUrl will succeed, and if it somehow fails, configurationUrl (the Studio Web automation-configuration page) still works because the user is already in the portal
  • SDK/widgets can run externally — getConnectionAuthUrl will fail for external apps, and configurationUrl is useless outside the portal, so falling back to connectionsUrl (the Orchestrator connections page) is more useful since a logged-in user can at least manage connections there

So same core behavior (auth URL first), smarter fallback for the broader audience.

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.

Pull request overview

Adds Conversational Agent “personal connections” support to the TypeScript SDK by introducing connection models, endpoints, and service methods, plus documentation updates and a sample app UI demonstrating connection selection.

Changes:

  • Added connection-related models and exported them via the Conversational Agent model barrel.
  • Added new ConversationalAgentService methods + endpoints for listing/updating connection selections and generating auth URLs, with unit tests.
  • Updated OAuth scope documentation and added sample app hooks/components to demonstrate connections UI.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/unit/services/conversational-agent/connections.test.ts Adds unit tests covering connections endpoints, update behavior, auth URL, and fallback logic.
src/utils/constants/endpoints/conversational-agent.ts Introduces CONNECTIONS and CONNECTION_AUTH endpoints under AGENT_ENDPOINTS.
src/services/conversational-agent/conversational-agent.ts Adds SDK methods for fetching/updating connection selections and resolving “add connection” URLs.
src/models/conversational-agent/index.ts Re-exports new connections models from Conversational Agent model index.
src/models/conversational-agent/conversational-agent.models.ts Extends the service model interface with the new connections methods and types.
src/models/conversational-agent/connections/index.ts New barrel export for connections types.
src/models/conversational-agent/connections/connections.types.ts Defines the new connections-related request/response and domain types.
samples/conversational-agent-app/src/hooks/useConnections.ts Adds a hook to load, stage, and save per-connector connection selections.
samples/conversational-agent-app/src/context/ConversationalAgentContext.tsx Exposes conversationalAgent and setError via context for the sample UI.
samples/conversational-agent-app/src/components/Sidebar.tsx Adds a sidebar overlay panel entry-point for connection settings in the sample app.
samples/conversational-agent-app/src/components/ConnectionsPanel.tsx Adds a sample UI panel for selecting connections per connector binding.
docs/oauth-scopes.md Documents required OAuth scopes for the new connections methods and updates combined scopes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread samples/conversational-agent-app/src/hooks/useConnections.ts
Comment thread src/models/conversational-agent/connections/connections.types.ts Outdated
Comment thread src/services/conversational-agent/conversational-agent.ts Outdated
Comment thread src/services/conversational-agent/conversational-agent.ts
Comment thread tests/unit/services/conversational-agent/connections.test.ts Outdated
Comment thread src/models/conversational-agent/connections/connections.types.ts Outdated
}),
);

// ===== TEST SUITE =====

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Missing integration test — rules.md requires: "Every new method must also have an integration test in tests/integration/shared/{domain}/."

The three new public methods (getAvailableConnections, updateConnectionSelections, getAddConnectionUrl) need a corresponding file at tests/integration/shared/conversational-agent/connections.integration.test.ts.

If the connections endpoints reject PAT auth (similar to insightsrtm_ endpoints), the convention allows describe.skip with an explanatory comment — but the file and test structure still need to exist. See tests/integration/shared/agents/agents.integration.test.ts for the pattern.

@claude

claude Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Review summary

Two new findings this run (all previously-raised threads were checked; confirmed fixed or skipped per dedupe policy).

New inline comments posted:

  1. connections.types.ts line 104 — expiresAt violates the *Time suffix convention; suggest renaming to expiredTime (or expiresTime).

  2. connections.test.ts line 74 — No integration test file for the three new public methods. Needs tests/integration/shared/conversational-agent/connections.integration.test.ts (can use describe.skip with an explanation if the endpoint rejects PAT auth).

Comment thread tests/unit/services/conversational-agent/connections.test.ts Outdated
@claude

claude Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Review summary

Thread unresolved:
The integration test thread was resolved but the file was never created. Unresolved it — needs a file at tests/integration/shared/conversational-agent/connections.integration.test.ts covering getAvailableConnections, updateConnectionSelections, and getAddConnectionUrl. A describe.skip with an explanatory comment is acceptable if the endpoint rejects PAT auth.

New inline comment:
connections.test.ts lines 195–199 — The getConnectionAuthUrl success test mocks the already-renamed SDK field (expiresTime) rather than the raw API wire field (expiresAt), so ConnectionAuthMap is never exercised. A bug in the map would leave the test green.

Comment thread src/services/conversational-agent/conversational-agent.ts Outdated
@claude

claude Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Review summary

One new finding this run; all previously-raised threads confirmed fixed or skipped per dedupe policy.

New inline comment posted:

conversational-agent.ts lines 197-201 — The getFeatureFlags class method has JSDoc added by this PR. The interface already has the same JSDoc; the duplicate on the class disables TypeScript JSDoc inheritance. The previous resolved thread fixed three other methods but this fourth method picked up a new JSDoc block in the same PR. Per conventions.md, class methods must carry no JSDoc when declared on the interface.

@claude

claude Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

✅ No issues found. Checked for bugs and CLAUDE.md compliance.

Comment thread src/models/conversational-agent/conversational-agent.models.ts
Comment thread src/models/conversational-agent/conversational-agent.models.ts
@claude

claude Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Review summary

One new finding this run; all previously-raised threads confirmed fixed or skipped per dedupe policy.

New inline comments posted:

  • conversational-agent.models.ts line 206 — getAvailableConnections @returns missing {@link AvailableConnectionsResponse} (convention: every method's @returns must link the response type).
  • conversational-agent.models.ts line 225 — updateConnectionSelections @returns same issue.

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.

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated no new comments.

Suppressed comments (4)

samples/conversational-agent-app/src/components/ConnectionsPanel.tsx:83

  • This is an icon-only dismiss button, but it has no accessible name. Add an aria-label so assistive tech can announce what it does.
          <button onClick={() => setSaveStatus(null)} className="ml-2 hover:opacity-80">

samples/conversational-agent-app/src/hooks/useConnections.ts:82

  • In save, the callback reads initialSelections but initialSelections is missing from the useCallback dependency array. This can make the diff logic use stale baseline selections after a reload/save, causing changed selections to be missed.
        selections: Object.entries(stagedSelections)
          .filter(([connectorKey]) => stagedSelections[connectorKey] !== initialSelections[connectorKey])
          .map(([connectorKey, connectionId]) => ({ connectorKey, connectionId: connectionId || null }))

samples/conversational-agent-app/src/components/ConnectionsPanel.tsx:58

  • The early returns for loading / empty states don’t render any close control, but this panel is shown as a full overlay. If connections are empty (or loading stalls), the user can’t close the panel.

This issue also appears on line 83 of the same file.

  if (isLoading) {
    return (
      <div className="p-6 flex items-center gap-3 text-gray-400">
        <Spinner className="w-4 h-4 border-accent" />
        <span className="text-sm">Loading connections...</span>

samples/conversational-agent-app/src/components/Sidebar.tsx:163

  • This icon-only button relies on title for its accessible name. For screen readers, add an explicit aria-label so the control is discoverable.
            <button
              onClick={() => setShowConnections(true)}
              className="p-1.5 hover:bg-white/10 rounded transition-colors"
              title="Connection settings"
            >

Comment thread samples/conversational-agent-app/src/components/ConnectionsPanel.tsx Outdated
Comment thread samples/conversational-agent-app/src/components/ConnectionsPanel.tsx Outdated
@claude

claude Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

✅ No issues found. Checked for bugs and CLAUDE.md compliance.

@maninder-uipath maninder-uipath left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please add integration tests also

@claude

claude Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

✅ No issues found. Checked for bugs and CLAUDE.md compliance.

@claude

claude Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

✅ No issues found. Checked for bugs and CLAUDE.md compliance.

@sonarqubecloud

Copy link
Copy Markdown

@norman-le
norman-le merged commit c7a56c9 into main Aug 11, 2026
22 of 25 checks passed
@norman-le
norman-le deleted the feat/cas-personal-connections branch August 11, 2026 23:22
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.

5 participants