Libra CodeHub

CedarCopilot/cedar-mail

Branch: staging

feat(automation): route the model experiment to Sol on its own Understudy workload

merged#2736CedarCopilot

CedarCopilot wants to merge 0 commits into staging from feat/automation-sol-experiment

Live on prod, no production signal yetTimeline and evidence
  1. Opened
    Sep 8, 2026, 6:30 PM
  2. Merged
    Sep 8, 2026, 7:20 PM
  3. Live on prod
    Sep 8, 2026, 7:20 PM
  4. Observed 2 days
    Sep 8, 2026, 7:20 PM
  5. Pipelines steady after this deploy
    Sep 8, 2026, 7:20 PM
  6. Unobserved

    Live on prod, no production signal yet

    Sep 11, 2026, 6:40 PM

Behaviors Libra is checking

When the cedar-automation-model-experiment flag is enabled, strategist, pipeline-review, meeting-prep, and daily-agenda automation patterns run through the Sol model gpt-5.6-sol instead of Sonnet or the former Kimi/DeepSeek assignments.Degradedlow confidence

Strict CloudWatch fallback found 2 prod failure log lines for [run-chat-agent-sdk] query() failed (Claude Code process aborted by user) in the last 24h while checking /deepseek, runautomationinprocess, deepseek, automation-agent, automations-service.test.

prod, checked Sep 11, 2026, 6:40 PM
Sol experiment executions use the dedicated Understudy automation-sol workload while non-experiment automation continues using the existing shared automation workload and routing behavior.Not checked
prod, checked Sep 11, 2026, 6:38 PM

Libra has verdicts on 0 of 2 tracked behaviors on prod; 2 are still being checked. Libra has 1 low-confidence degraded verdict it is still confirming. Libra checks hourly for 3 days after each deploy.

Summary

  • Replaces the Kimi K3 / DeepSeek V4 Pro per-pattern split (strategist/pipeline-review/meeting-prep → Kimi K3, daily-agenda → DeepSeek V4 Pro) with a single new candidate, Sol (gpt-5.6-sol), for all four patterns , that experiment's real-world savings were modest and inconsistent (see the Sep 2026 staging A/B in #understudy-cedar).
  • The flagged population now routes to its own Understudy workload (automation-sol) instead of sharing the automation workload with a tags.experiment split , so the unflagged path's request shape is completely untouched by this change.
  • MODEL_EXPERIMENT_AGENT_BY_PATTERN (a Record<pattern, agent>) collapses to MODEL_EXPERIMENT_PATTERNS (a Set<pattern>) since every experiment pattern now maps to the same agent.
  • Still gated by the existing cedar-automation-model-experiment PostHog flag (default off).

Merge prerequisite (already done)

The automation-sol Understudy workload does not pre-exist and must be registered before this can route without a workload_not_found 400. I registered it via the understudy CLI before opening this PR:

understudy workloads create automation-sol --project cedar --capture

(id usp_01a0838d02027051b4729b40)

Test plan

  • pnpm --filter @zero/server run types , passes
  • pnpm --filter @zero/server exec vitest run src/services/aop/__tests__/automations-service.test.ts , 20 passed
  • pnpm deps:check , no dependency-direction violations
  • Flip cedar-automation-model-experiment on for an internal test user and confirm a strategist/pipeline-review/meeting-prep/daily-agenda run actually routes to automation-agent-sol and shows up under the automation-sol workload in Understudy's cost dashboard

🤖 Generated with Claude Code

https://claude.ai/code/session_017pZCUbjXJgwakzPsbtNbip

Greptile Summary

This PR replaces the Kimi K3/DeepSeek automation experiment with a single Sol agent and isolates flagged traffic on the new automation-sol Understudy workload.

  • Adds and registers automationAgentSol using gpt-5.6-sol.
  • Routes four canonical automation patterns to Sol behind the existing PostHog flag.
  • Removes the superseded experimental model constants and agents.
  • Updates comments and test mocks, but does not test the new routing decisions.

Confidence Score: 4/5

The implementation appears safe to merge, with a non-blocking test-coverage gap around the new experiment routing.

The routing logic is internally consistent and uses canonical pattern names, but the tests never exercise the experiment flag, Sol selection, fallback behavior, or flag precedence.

Files Needing Attention: apps/server/src/services/aop/tests/automations-service.test.ts

Important Files Changed

FilenameOverview
apps/server/src/mastra/agents/automation-agent.tsReplaces the two previous experiment agents with a Sol agent on a dedicated Understudy workload.
apps/server/src/services/aop/automations.tsConsolidates the pattern mapping into a set and gives eligible flagged runs precedence for Sol routing.
apps/server/src/services/aop/tests/automations-service.test.tsUpdates the agent mock export but leaves the newly introduced experiment-routing branches untested.
apps/server/src/services/llm/models.tsReplaces the prior experimental model constants with the Sol model identifier.
apps/server/src/mastra/index.tsRegisters the new Sol agent and removes the superseded experiment agents.

Flowchart

rendering diagram…
Show production surfaces and changed-file mapping

Production surfaces

Libra has not measured any production surfaces for this change yet.

Changed files → surfaces

  • apps/server/src/mastra/agents/automation-agent.tsno production surface mapped
  • apps/server/src/mastra/index.tsno production surface mapped
  • apps/server/src/services/aop/__tests__/automations-service.test.tsno production surface mapped
  • apps/server/src/services/aop/automations.tsno production surface mapped
  • apps/server/src/services/llm/models.tsno production surface mapped
  • apps/server/src/services/llm/resolve-model.tsno production surface mapped
  • apps/server/src/services/posthog/posthog.tsno production surface mapped