Skip to content

feat(DATAGO-132732): Add singleAgentMode support to ChatContext#1433

Open
DevSol-UQ wants to merge 1 commit intomainfrom
uqamar/DATAGO-132732
Open

feat(DATAGO-132732): Add singleAgentMode support to ChatContext#1433
DevSol-UQ wants to merge 1 commit intomainfrom
uqamar/DATAGO-132732

Conversation

@DevSol-UQ
Copy link
Copy Markdown

Summary

Adds singleAgentMode support to the community library to enable URL-based single-agent mode in enterprise applications.

Changes

New Fields

ChatContext.ts:

  • singleAgentMode: boolean - State indicating if single-agent mode is active
  • setSingleAgentMode - Setter to control single-agent mode

ChatProvider.tsx:

  • Initialize singleAgentMode state (default: false)
  • Expose in context value

SharedChatProvider.tsx:

  • Add field with false value (shared sessions don't support single-agent mode)
  • Add no-op setter for interface compatibility

ChatInputArea.tsx:

  • Conditionally hide agent selector when singleAgentMode === true
  • Wrapped in {!singleAgentMode && (<>...</>)} guard

Behavior

Default (Normal Mode):

  • singleAgentMode: false
  • Agent selector visible
  • No breaking changes

Single-Agent Mode (when enabled by consumer):

  • singleAgentMode: true
  • Agent selector hidden
  • User cannot change agents

Testing

  • ✅ All existing tests pass
  • ✅ No breaking changes to existing behavior
  • ✅ Backward compatible (defaults to false)

Enterprise Usage

Enterprise applications can now control the agent selector visibility:

```typescript
// In enterprise provider
const urlAgent = getAgentFromUrl(); // Parse ?agent= from URL
if (urlAgent) {
setSingleAgentMode(true);
setSelectedAgentName(urlAgent);
}
```

Related

  • Enterprise PR: solace-agent-mesh-enterprise (to be created)
  • JIRA: DATAGO-132732
  • Use Case: Teams Gateway integration - lock each team channel to a dedicated agent

🤖 Generated with Claude Code

Add URL-based single-agent mode support to the community library.
This enables enterprise applications to lock the UI to a specific agent
via URL parameter (?agent=AgentName).

## Changes

### ChatContext.ts
- Add `singleAgentMode: boolean` to ChatState interface
- Add `setSingleAgentMode` setter to ChatActions interface

### ChatProvider.tsx
- Initialize `singleAgentMode` state (default: false)
- Add `singleAgentMode` and `setSingleAgentMode` to context value

### SharedChatProvider.tsx
- Add `singleAgentMode` field (always false for shared sessions)
- Add `setSingleAgentMode` no-op setter for interface compatibility

### ChatInputArea.tsx
- Conditionally hide agent selector when `singleAgentMode === true`
- Wrap agent dropdown in `{!singleAgentMode && (<>...</>)}` guard

## Testing

- All existing tests pass (no breaking changes)
- Default behavior unchanged (singleAgentMode defaults to false)
- Enterprise applications can now control agent selector visibility

## Related

- Enterprise implementation: solace-agent-mesh-enterprise PR #TBD
- JIRA: DATAGO-132732
@github-actions
Copy link
Copy Markdown

✅ FOSSA Guard: Licensing (SolaceLabs_solace-agent-mesh) • PASSED

Compared against main (9eaf351dd4ae4e05a1bfd7b6d9d0c8fdef0b9ab8) • 0 new, 9 total (9 in base)

Scan Report | View Details in FOSSA

@github-actions
Copy link
Copy Markdown

✅ FOSSA Guard: Vulnerability (SolaceLabs_solace-agent-mesh) • PASSED

Compared against main (9eaf351dd4ae4e05a1bfd7b6d9d0c8fdef0b9ab8) • 0 new, 1 total (1 in base)

Scan Report | View Details in FOSSA

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