Skip to content

C1. Autoscale & dynamic throughput management #164

Closed

Description

Why

Throughput is the primary Cosmos DB cost/perf lever, yet the Shell can't view or change it. Autoscale (dynamic scaling) and RU/s changes are exactly the kind of routine, RU-cost-sensitive operation agents and CI should manage safely — and it pairs with the RU guardrails (item G2).

Proposed behavior

  • throughput [--db --con] shows mode (manual/autoscale), current RU/s and autoscale max.
  • throughput set --ru N / --autoscale-max N / --mode manual|autoscale scales or switches modes at database and container scope, via ARM.
  • Surface RU/s and estimated cost delta before applying.

Acceptance criteria

  • View + set RU/s and autoscale max.
  • Switch manual↔autoscale.
  • Database and container scope.
  • Structured output with RU/s + cost delta.
  • Safe over MCP behind confirmation (M3) / dry-run (G1).
  • Docs + tests.

Filed from the Agentic & Automation Roadmap (docs/agentic-roadmap.md), item C1, Wave 2. Priority P1.

Activity

  1. mkrueger commented on Jul 7, 2026

    @mkrueger
    Collaborator

    Cross-checked the MCP-safety criterion against how this shell actually does MCP safety.

    How safety works here: it's annotation-driven client-side approval, not server-side prompts. McpAnnotationAttribute exposes ReadOnly / Destructive / Idempotent / OpenWorld, mapped to MCP hints in ToolOperations.cs, and ServerInstructions.md + docs/mcp.md instruct clients to require manual approval for Destructive tools (rm, rmdb, rmcon, delete). Server-side confirmation isn't possible over MCP — the interactive prompt in ThroughputCommand.ConfirmWrite is deliberately skipped when McpPort is set, because there's no console to prompt on.

    Done ✅

    • throughput is exposed as an MCP tool with ReadOnly = false.
    • Writes are non-interactive-safe (no blocking prompt under MCP).

    Gaps ⚠️

    1. The tool is ReadOnly = false but not annotated Destructive and carries no idempotency hint, so clients treat it like an ordinary mutating tool — not one that needs the "stop and ask" treatment deletes get. A throughput change directly moves the bill (e.g. autoscale 100k RU/s), so it should surface for approval.
    2. docs/mcp.md and ServerInstructions.md have no throughput coverage — clients aren't told to confirm RU/cost changes.

    Recommendation: reframe this criterion as an annotation + docs fix rather than server-side confirmation (M3) / dry-run (G1), which don't fit this architecture. Concretely: annotate the write path conservatively (billing-impact / destructive-style hint — noting show is read-only while set/manual/autoscale are writes but share one tool), and add throughput guidance to docs/mcp.md + ServerInstructions.md. That achieves "safe over MCP" consistently with the rest of the shell.

  2. mkrueger commented on Jul 9, 2026

    @mkrueger
    Collaborator

    #166 merged.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1control-planeCosmos DB control-plane managementenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions