Skip to content

[Portal]: useForHarness checkbox in the AI integration form #228

Description

@07prajwal2000

Why

useForHarness decides whether an AI integration may drive an agent harness conversation. The whole path exists except the one control that sets it:

  • the flag is in the config schema for all five AI variants, defaulting to false (apps/server/src/api/v1/integrations/schemas.ts:180,188,196,204,217)
  • the gate reads it (apps/ai-gateway/src/api/v1/harness-conversations/send-message/service.ts:26)
  • the filtered list endpoint exists: GET /api/v1/integrations/:projectId/list-basic?useForHarness=true (get-basic-list)
  • the portal already calls that endpoint with the filter (apps/portal/src/services/integrations.ts:25, query/integrationsQuery.ts:21)

Nothing can set it to true. Two comments in the codebase already say so:

  • schemas.ts:174 - TODO(ui): build a toggle in the AI integration form to flip useForHarness.
  • send-message/service.ts:18 - ...and there is no UI yet to flip useForHarness.

Result: the harness falls back to the project's configured default agent, and a user cannot opt any other AI integration into the pool.

What

Add a useForHarness checkbox to the AI connector form in the portal: apps/portal/src/components/integrations/connectors/AiForm.tsx.

  • AI group only. Database, KV, and observability configs have no such field and must not grow one.
  • Applies to every AI variant the form serves: OpenAI, Anthropic, Gemini, Mistral, and OpenAI-Compatible (showBaseUrl).
  • Defaults to unchecked - the schema default is false and nothing should become harness-eligible implicitly.
  • Reads the current value on edit and persists it on create and update, like the other config fields via setField.
  • Use Checkbox from @fluxify/components, not a raw HeroUI checkbox (see AGENT.md - the shared one is theme-aware and self-contained).
  • Give it a short description saying what it does: this integration can be selected to run agent harness conversations.

Remove the TODO(ui) comment at schemas.ts:174 and correct the stale "there is no UI yet" sentence in send-message/service.ts:18 once it ships.

Out of scope

Any change to how the harness picks a model when several integrations are eligible. This issue only exposes the flag.

Done when

  • An AI integration can be created and edited with useForHarness on or off from apps/portal.
  • The value round-trips: saved, reloaded on edit, and reflected in list-basic?useForHarness=true.
  • A newly created AI integration is not harness-eligible unless the box was ticked.
  • Non-AI integration forms are unchanged.
  • bun run --cwd apps/portal lint passes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions