Skip to content

Add per-agent model override for public communication channels #894

Closed

Description

@vybe

Summary

Add a per-agent setting in the Sharing UI to select which Claude model is used for all public-facing channels (public chat link, Slack, Telegram, WhatsApp). Today public chats always use the platform-wide default model with no per-agent override available to agent owners.

Context

Currently the model resolution for public chats is:

  • routers/public.py:610-618 calls task_execution_service.execute_task() with model=None
  • services/task_execution_service.py:286-287 falls back to settings_service.get_platform_default_model()
  • services/settings_service.py:233-247 reads system_settings.platform_default_model (hardcoded fallback claude-sonnet-4-6)

This means:

  • The only knob is platform-wide (admin-only).
  • Agent owners cannot opt their public-facing agent into a cheaper model (Haiku) for cost control or a more capable model (Opus) for quality on a per-agent basis.
  • The same problem applies to Slack/Telegram/WhatsApp adapter messages routed through adapters/message_router.py, which currently inherits the same default.

Sharing is the natural home for this setting — it already governs how external users reach the agent (sharing list, public link, channel bindings, access policy).

Acceptance Criteria

  • New column on agent_ownership (e.g. public_channel_model TEXT NULL) — NULL means inherit platform default.
  • GET /api/agents/{name}/public-channel-model returns the resolved value + whether it is overridden.
  • PUT /api/agents/{name}/public-channel-model allows owner/admin to set or clear the override; validates against a known model whitelist (Opus 4.7, Sonnet 4.6, Haiku 4.5).
  • routers/public.py and adapters/message_router.py resolve model in this order: per-agent override → platform default → hardcoded fallback.
  • Sharing tab in AgentDetail.vue gains a model selector with three options + "Use platform default".
  • Audit log entry written when override is changed (event_type agent_lifecycle, action update_public_model).
  • Existing scheduler-triggered runs (which already have their own agent_schedules.model per-schedule column) are unaffected.

Technical Notes

  • Three surfaces to update (Architectural Invariant Setup improvements #5/feat: SMARTS trading pipeline with Telegram notifications and Miro visualization #13): backend router + service, frontend Pinia store + Sharing view, and probably a new MCP tool is not required (this is owner-facing config, not agent-callable).
  • Model whitelist should live in one place — consider extending settings_service with a is_valid_model() helper rather than duplicating the list.
  • Keep the column NULL-default so this is a purely additive migration; no backfill needed.
  • Worth a brief look at whether agent_schedules.model and this new field should share validation logic.

Activity

  1. added
    priority-p2
    type-feature
    on May 18, 2026
  2. added
    theme-channels
    complexity-low
    on Jun 3, 2026
  3. added
    status-incubating
    status-ready
    and removed
    status-incubating
    on Jun 14, 2026
  4. removed
    status-ready
    on Jun 29, 2026
  5. dolho commented on Jun 29, 2026

    @dolho
    Contributor

    /claim

  6. github-actions commented on Jun 29, 2026

    @github-actions

    Claimed by @dolho. Label status-in-progress added.

    Next steps:

    1. Create branch: feature/894-<short-slug>
    2. Implement the feature
    3. Open a PR with Fixes #894
  7. added
    status-in-progress
    on Jun 29, 2026
  8. added
    status-in-dev
    on Jun 30, 2026
  9. 11 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

complexity-lowpriority-p2theme-channelstype-feature

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions