Skip to content

Agents v1 (17/17): Documentation — feature guide, API/MCP/CLI reference, operations and limitations #2816

Closed

Description

@propr-dev

Context

Agents touch every surface (UI, REST, MCP, CLI, worker, daemon) and have security- and cost-relevant behavior (delegated MCP grants, cost gate, capabilities). Operators and users need one coherent guide, and the existing references (MCP guide, CLI reference, settings catalog, execution safety) must mention the new pieces. ProPR's bundled docs are also served to MCP clients via search_docs/get_doc, so good docs directly improve chat-driven use.

Requirements

  1. New docs/docs/features/agents.md (add to docs/sidebars.ts under Core Workflow, after Goals):
    • What an Agent is (saved definition → isolated task run → free-form report), and what it is not (no new engine, no event watching in v1, no structured actions).
    • Creating an agent: scope, prompt + files, previous reports, model, capabilities (with the enforcement table: Claude/Codex native; others best-effort for web; MCP only Claude/Codex), schedule (5-field cron, UTC, min 15 min, presets), autonomy modes.
    • Triggers: Run now, schedule, and the trigger primitive over HTTP/MCP/CLI, with copy-paste examples: curl with Idempotency-Key, a GitHub Actions workflow step, a crontab line, an MCP trigger_agent_run call.
    • Reports and previous reports; report view; truncation.
    • Acting step and autonomy (dry run / preview + approve / auto), what the acting agent can and cannot do (scopes read/plan/execute, repositories only, no merge/deploy/settings, cannot trigger agents).
    • Cost control: the pause threshold, defer vs. skip rules, bounded deferrals, attended Run now warning, fail-open when Agent Tank has no data.
    • Run states table and troubleshooting (skipped with reason, GITHUB_AUTHORIZATION_REQUIRED, MCP_DISABLED, offboarded owner disables schedule).
  2. Update docs/mcp.md (new "Agents" section) and docs/mcp-coverage.md (tool rows).
  3. Update docs/docs/features/propr-cli.md (propr automation group, exit codes, JSON kinds).
  4. Update docs/docs/features/execution-safety.md (agent runs never commit/push; workspace without repository code when repository_read is off; delegated MCP grant lifetime and revocation; SYSTEM_TASK_SECRET now also signs agent grant requests).
  5. Update docs/docs/operations/agent-tank.md (Agents cost gate consumes usage data).
  6. Update docs/docs/features/web-ui.md (Agents page).
  7. Settings catalog (packages/api/mcp/settingsCatalog.ts) entries for the usage-pause threshold (if added in issue 11) and env vars PROPR_INTERNAL_API_URL, PROPR_AGENT_MCP_URL; add them to .env.example with comments.
  8. CHANGELOG.md entry.
  9. npm run build in docs/ passes; the mcpObservableSurface test that checks documented tool names against the catalog passes.

Implementation Specification

  • Examples must use the real routes/flags from issues 5, 13 and 14.
  • State explicitly what is deferred: built-in event triggers/label watching and per-action-kind autonomy.

Acceptance Criteria

  • docs builds; new page appears in the sidebar.
  • Every new MCP tool appears in docs/mcp-coverage.md.
  • search_docs for "agent schedule" returns the new page (bundled docs manifest regenerated).
  • .env.example documents the two new variables.

Created by ProPR AI Planner

Activity

  1. propr-dev commented on Oct 6, 2026

    @propr-dev
    ContributorAuthor

    Suggested Implementation:

    Implementation Approach

    One feature page carries the user-facing story; existing references get short, linked additions instead of duplicated content. Because bundled docs are also an MCP knowledge source, the feature page uses concrete examples (exact routes, tool names, CLI flags) that a connected chat client can follow verbatim.

    File: docs/docs/features/agents.md (new file)

    Why this file: The canonical guide to Agents for users and operators.

    ---
    title: Agents
    ---
    
    # Agents
    
    An **Agent** is a saved, reusable instruction that ProPR runs on demand or on a
    schedule. Each run is an ordinary isolated ProPR task (sandboxed checkout,
    your chosen model, tool access, a durable task record) and its result is a
    **free-form report** written for a human: bug triage, market research, product
    comparisons, "what changed since last week", feature ideas.
    
    Agents do not introduce a new execution engine and do not watch GitHub events.
    For event-driven runs, call the trigger from your own automation (below).
    
    ## Creating an agent
    
    Open **Agents → New agent** and set:
    
    | Field | Notes |
    | --- | --- |
    | Repositories | 1-10 enabled repositories you can access. The first is the primary checkout. |
    | Prompt and files | What to investigate. Files are copied into the run workspace. |
    | Previous reports | Include the last 0-5 reports so the agent reports what changed instead of repeating itself. |
    | Model | Any enabled model from the catalog (direct agents or synthetic pools). |
    | Capabilities | Repository code, Web browsing, ProPR tools (read). Each is separate. |
    | Schedule | Optional 5-field cron in **UTC**, at most every 15 minutes. |
    | After the report | Dry run, Preview + approve, or Auto. |
    
    Capability enforcement:
    
    | Capability | Claude / Codex | Antigravity / OpenCode / Vibe |
    | --- | --- | --- |
    | Repository code off | No source mounted | No source mounted |
    | Web off | Blocked by the CLI (`--disallowedTools` / `tools.web_search=false`) | Instruction only (best effort) |
    | ProPR tools | Short-lived scoped MCP grant | Not available in v1 |
    
    ## Triggering runs
    
    All triggers use one primitive with an idempotency key, so retries never start two runs.
    
    ~~~bash
    # HTTP (bearer or session); the same key returns the same run.
    curl -X POST "$PROPR/api/agent-definitions/$AGENT_ID/runs" \
      -H "Authorization: Bearer $GITHUB_TOKEN" -H "Content-Type: application/json" \
      -H "Idempotency-Key: nightly-$(date -u +%F)" -d '{"source":"my-crontab"}'
    
    # CLI (also from cron or CI)
    propr automation run "$AGENT_ID" --idempotency-key "gh-$GITHUB_RUN_ID-$GITHUB_RUN_ATTEMPT" --wait

    GitHub Actions, for example to run a triage agent whenever an issue is labelled bug:

    on: { issues: { types: [labeled] } }
    jobs:
      triage:
        if: github.event.label.name == 'bug'
        runs-on: ubuntu-latest
        steps:
          - run: npx propr-cli automation run "${{ vars.TRIAGE_AGENT_ID }}" --idempotency-key "issue-${{ github.event.issue.number }}-${{ github.run_attempt }}" --source "github-actions:${{ github.repository }}#${{ github.event.issue.number }}"
            env: { PROPR_REMOTE: ${{ vars.PROPR_URL }}, PROPR_TOKEN: ${{ secrets.PROPR_TOKEN }} }

    MCP: trigger_agent_run with definitionId and idempotencyKey.

    Reports and the acting step

    The report is shown on the run page as Markdown. ProPR never parses it.
    Acting on it is a separate agent run that receives the report and may only use
    ProPR tools (create tasks and TODOs, comment on pull requests) on the agent's
    repositories. It cannot merge, deploy, change settings or start other agents.

    Mode After the report
    Dry run Nothing else happens.
    Preview + approve You get an Inbox item; approve (optionally with a note) or reject.
    Auto The acting step starts immediately (paused for approval when usage is near the limit).

    Cost control

    Scheduled, API, MCP and CLI runs are checked against your subscription
    pause threshold using Agent Tank data before they start:

    • weekly usage at or over the threshold: the run is skipped with the reason;
    • session usage at or over the threshold: the run is deferred until the
      window resets (checked every minute, at most 6 deferrals, then skipped);
    • no usage data (Agent Tank off or unreachable): the run proceeds;
    • Run now from the UI always runs but warns first.

    Run states

    queued → running → report_ready → completed | awaiting_approval → acting → completed,
    plus deferred, skipped, rejected, failed, cancelled. Every skip, deferral
    and failure records a sentence explaining why.

    Not in v1

    Built-in event triggers / label watching (use the trigger primitive) and
    per-action-kind autonomy policies.

    
    (Note for the implementer: Docusaurus Markdown nests fences — use ```` ``` ```` fences inside the page; the `~~~` above are only how this issue renders them.)
    
    ### File: `docs/sidebars.ts`
    
    ~~~diff
    --- a/docs/sidebars.ts
    +++ b/docs/sidebars.ts
    @@ Core Workflow
             'features/goals',
    +        'features/agents',
    

    File: docs/mcp.md / docs/mcp-coverage.md

    --- a/docs/mcp-coverage.md
    +++ b/docs/mcp-coverage.md
    @@
    +| List / read Agents | `list_agent_definitions`, `get_agent_definition`, `get_agent_definition_contract` | read |
    +| Agent run history and reports | `list_agent_runs`, `get_agent_run` | read |
    +| Trigger an Agent run (cost-gated, idempotent) | `trigger_agent_run` | execute |
    +| Approve / reject a preview-mode report | `approve_agent_run`, `reject_agent_run` | execute |

    In docs/mcp.md add an "## Agents" section after "Start a one-off task" with the trigger_agent_run JSON example, the receipt lifecycle (completed when the run completes/rejects/skips), and the recursion rule.

    File: docs/docs/features/execution-safety.md

    --- a/docs/docs/features/execution-safety.md
    +++ b/docs/docs/features/execution-safety.md
    @@
    +## Agent runs
    +
    +Agent report and acting runs use the same per-run container and worktree isolation
    +as tasks but never commit or push. With **Repository code** off the container gets an
    +empty workspace. When ProPR tools are needed, the worker obtains a delegated MCP grant
    +for the agent's owner via an internal endpoint signed with `SYSTEM_TASK_SECRET`:
    +scopes `read` (report) or `read, plan, execute` (acting), limited to the agent's
    +repositories, expiring after 2 hours and revoked when the step ends. The token reaches
    +the container only as an environment variable and is redacted from logs.

    File: packages/api/.env.example

    --- a/packages/api/.env.example
    +++ b/packages/api/.env.example
    @@
    +# Agents: how the worker reaches the API for scoped MCP grants (Docker network URL),
    +# and the MCP URL handed to agent containers. Defaults suit the bundled Compose stack.
    +PROPR_INTERNAL_API_URL=http://api:4000
    +# PROPR_AGENT_MCP_URL=http://api:4000/api/mcp

    File: CHANGELOG.md

    --- a/CHANGELOG.md
    +++ b/CHANGELOG.md
    @@
    +### Added
    +- **Agents**: saved definitions that run on demand, on a UTC cron schedule, or via the
    +  trigger primitive (HTTP, MCP `trigger_agent_run`, `propr automation run`) and produce
    +  a free-form report. Optional acting step with dry-run, preview + approve and auto modes,
    +  scoped short-lived MCP grants, and an Agent Tank usage gate for unattended runs.

    Also add the CLI section to docs/docs/features/propr-cli.md (commands, exit codes 0/1/2/3/4, JSON kinds), a short "Agents" paragraph to docs/docs/features/web-ui.md, and a "Used by Agents" note to docs/docs/operations/agent-tank.md. Regenerate the bundled docs manifest with the existing docs generator script so search_docs finds the page.

  2. propr-dev commented on Oct 7, 2026

    @propr-dev
    ContributorAuthor

    🤖 AI processing has started for this issue using claude agent with claude-opus-5-5 model.

    I'll analyze the problem and work on a solution. This may take a few minutes.

    Processing Details:

    • Agent: claude
    • Model: claude-opus-5-5
    • Branch: 2816/claude-opus-5-5-agents-v1-17-17-documenta-20261007-1623-sdx
    • Base Branch: 2800-epic-agents-v1-y7t
    • Worktree: issue-2816-20261007-1623-claude-opus-5-5-sdx

    🔍 Track Task Execution

  3. added a commit that references this issue on Oct 7, 2026
  4. added a commit that references this issue on Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions