# update_repo_settings

URL: https://codepanel.ai/docs/mcp-server/update_repo_settings

The CodePanel MCP tool that sets a repository's auto-review, round limits, merge gate, review switches and who to escalate to.

`update_repo_settings` changes how CodePanel reviews one repository: whether it reviews automatically, how many rounds a pull request gets, which findings hold the `CodePanel` commit status, which panel it uses, which repository-level review switches apply, and who to ask when no agent can settle a finding. Send only the fields you want to change. It needs the `repos:write` scope and is the call behind most of a repository's setup.

## When to call it

- **After `connect_repo`,** to set the gate and round limit the repository should have.
- **When agents and reviewers go back and forth** on a pull request. Lower `maxAutoRounds`, or name people in `escalation` so a finding goes to someone who can decide it.
- **When a status doesn't hold a merge it should.** That is `gate`. Lowering it is a person's step in the dashboard (see [Merge protections](#merge-protections)).
- **To try a review switch on one repository** with `reviewSwitches` before the deployment turns it on for everyone.

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `repo` | string | yes | Repository as owner/name |
| `autoReview` | boolean | no |  |
| `maxAutoRounds` | integer, at most 50 or null | no | Automatic review rounds per pull request (1-50), or null for no limit. /review still runs past it. |
| `botMaxRounds` | integer, at most 50 or null | no | Rounds in all a bot commenting /rounds may extend a pull request to (0-50; 0 stops bots adding rounds), or null for the default of 5. Owners, members and collaborators are not held to it. |
| `stepBackAfterRounds` | integer, at most 50 or null | no | The round from which the review carries a step-back notice (payload.stepBack) advising to reconsider the approach rather than patch the latest finding (0-50; 0 turns it off), or null for the default of 3. It stops nothing and never changes the gate. |
| `idleNudgeHours` | integer, at most 23 or null | no | Hours without a push, comment, rating or read after which CodePanel posts one comment naming the pull request's nextAction, when that action is its author's (0-23; 0 turns it off), or null for the default of 6. Once per head commit, at most 10 a day per repository; it changes no status or gate. |
| `trustedBotAuthors` | array of strings, at most 10 or null | no | GitHub App logins, exact, such as ["my-agent[bot]"], whose pull requests are reviewed automatically and whose /review comments run like a member's; every other bot stays skipped. Their /rounds stays held to botMaxRounds. [] or null trusts none. A token may remove Apps but not add one; a person adds them in the dashboard. |
| `inlineSuggestions` | boolean | no | Also post critical and warning findings that have a checked patch as inline GitHub suggestion comments. Off by default; the summary comment and get_review are unchanged. |
| `panelId` | string or null | no | Panel to use, or null for the default |
| `gate` | `off` or `critical` or `warning_high` or `warning` or `all` | no | Findings that must be fixed or answered before the commit status passes: critical, warning_high (critical, and warnings rated high confidence), warning (critical and warning, the default), all, or off for no status. A token may raise it but not lower it, except that it may set warning_high from warning or all |
| `agentFiles` | boolean | no | Read AGENTS.md and CLAUDE.md from the base branch as review context (off unless turned on) |
| `reviewSwitches` | object | no | Review switches for this repository over the deployment's: REVIEW_CACHEABLE_PROMPTS, REVIEW_REVIEWER_TOOLS, REVIEW_PRECISION_RULES, REVIEW_CHANGED_LINES, REVIEW_LEARNING_ATTRIBUTION, REVIEW_BASE_MERGE_SCOPE, REVIEW_PROOF_GRADING, REVIEW_NOVEL_ESCALATION, REVIEW_HOLD_LATER_SUGGESTIONS, REVIEW_CONFIRM_FIXES, REVIEW_PREFIX_DIAGNOSTICS, REVIEW_CURRENT_PRACTICE, REVIEW_ORCHESTRATOR_CACHE, REVIEW_UNREVIEWED_FILES. REVIEW_CACHEABLE_PROMPTS and REVIEW_HOLD_LATER_SUGGESTIONS (rounds after the first hold back new suggestions into the review payload's heldBack) are on by default; the others are off. The response gives each one's deployment, override, effective value and source. |
| `reviewSwitches.REVIEW_CACHEABLE_PROMPTS` | boolean or null | no | true or false for this repository, null to follow the deployment again |
| `reviewSwitches.REVIEW_REVIEWER_TOOLS` | boolean or null | no | true or false for this repository, null to follow the deployment again |
| `reviewSwitches.REVIEW_PRECISION_RULES` | boolean or null | no | true or false for this repository, null to follow the deployment again |
| `reviewSwitches.REVIEW_CHANGED_LINES` | boolean or null | no | true or false for this repository, null to follow the deployment again |
| `reviewSwitches.REVIEW_LEARNING_ATTRIBUTION` | boolean or null | no | true or false for this repository, null to follow the deployment again |
| `reviewSwitches.REVIEW_BASE_MERGE_SCOPE` | boolean or null | no | true or false for this repository, null to follow the deployment again |
| `reviewSwitches.REVIEW_PROOF_GRADING` | boolean or null | no | true or false for this repository, null to follow the deployment again |
| `reviewSwitches.REVIEW_NOVEL_ESCALATION` | boolean or null | no | true or false for this repository, null to follow the deployment again |
| `reviewSwitches.REVIEW_HOLD_LATER_SUGGESTIONS` | boolean or null | no | true or false for this repository, null to follow the deployment again |
| `reviewSwitches.REVIEW_CONFIRM_FIXES` | boolean or null | no | true or false for this repository, null to follow the deployment again |
| `reviewSwitches.REVIEW_PREFIX_DIAGNOSTICS` | boolean or null | no | true or false for this repository, null to follow the deployment again |
| `reviewSwitches.REVIEW_CURRENT_PRACTICE` | boolean or null | no | true or false for this repository, null to follow the deployment again |
| `reviewSwitches.REVIEW_ORCHESTRATOR_CACHE` | boolean or null | no | true or false for this repository, null to follow the deployment again |
| `reviewSwitches.REVIEW_UNREVIEWED_FILES` | boolean or null | no | true or false for this repository, null to follow the deployment again |
| `escalation` | object or null | no | Escalate findings no agent can settle to these people: nextAction becomes escalate, the commit status names them and one PR comment asks them to answer with /feedback. Null clears it; absent leaves it. Off unless set. A token may add contacts but not remove them (403); a person removes them in the dashboard. |
| `escalation.contacts` | array of strings, at most 5 | yes | 1-5 GitHub logins to ask, @ optional |
| `escalation.triggers` | array of strings | no | When to ask: upheld_critical (a critical the orchestrator upheld after the author's dispute), round_limit (a critical left at the round limit), step_back (anything gated left while the step-back notice shows), novel (a warning or critical the orchestrator judged a decision for a person; needs REVIEW_NOVEL_ESCALATION on). Absent means upheld_critical and round_limit. |
| `crossFamilyReview` | object or null | no | Never judge a change only by the model family that wrote it: when the author's family is known, the orchestrator runs on a usable model of another family, with the choice on payload.crossFamily and the review comment. Null clears it; absent leaves it. Off unless set. A token may turn it on but not off (403); a person turns it off in the dashboard. |
| `crossFamilyReview.enabled` | boolean | yes |  |
| `crossFamilyReview.fullLanePaths` | array of strings, at most 50 | no | Globs over changed files; a pull request that changes one is full lane: its verdict also comes from a frontier model |
| `crossFamilyReview.fullLaneMarker` | string | no | A phrase or heading in the pull request description that makes it full lane, e.g. "## Whiteboard defense" |
| `autoFix` | object or null | no | Automatically dispatch a cloud fix agent when a review leaves blocking findings (mode: "blocking", maxAttempts: 1-5) or "off" / null to disable. |
| `autoFix.mode` | `off` or `blocking` | yes |  |
| `autoFix.maxAttempts` | integer, at most 5 | no |  |
| `convergence` | object | no | Switches that settle a pull request after its gate has passed, each off unless set; true turns one on, false or null off, names left out stay as they are. settleAfterGreen: once a head has passed, a later round's finding holds the merge only if critical or within 5 lines of a line changed since. orchestratorAdvisory: a finding no reviewer reported never holds the merge. disputeLearnings: a candidate learning becomes active once conceded disputes citing it on 3 pull requests. doneWarnsPush: retired and ignored; nextAction done always says to stop pushing. A token may set any of them; settleAfterGreen and orchestratorAdvisory narrow what blocks. |
| `convergence.settleAfterGreen` | boolean or null | no |  |
| `convergence.orchestratorAdvisory` | boolean or null | no |  |
| `convergence.disputeLearnings` | boolean or null | no |  |
| `convergence.doneWarnsPush` | boolean or null | no |  |
| `autoApproveOnPass` | boolean | no | false stops CodePanel posting an approving GitHub review when the merge gate passes. true is refused with 403: turning it on is a dashboard step, since an approval can satisfy a required review. |

It writes: the server marks it `readOnlyHint: false` and `destructiveHint: true` (it can change what is already there), so a client that asks before writes asks here.

A field you leave out stays as it is. A field set to `null` is cleared back to its default, for the fields that accept `null`. The call is one write: if any field is refused, none of them is applied.

### Merge protections

The tool runs on a token, and a token can tighten what blocks a merge but not loosen it. The agent is the one the gate holds, so lowering the gate is for a person. Each of these is refused with 403 and `code: "forbidden"`:

| Field | Refused from a token | Allowed from a token |
| --- | --- | --- |
| `gate` | A lower level, such as `warning` to `critical` or anything to `off` | The same level or a higher one, and `warning_high` from `warning` or `all` |
| `trustedBotAuthors` | Adding an App | The same list, or one with Apps removed |
| `escalation` | Removing a contact, including `null` | Adding contacts, changing `triggers` |
| `crossFamilyReview` | `enabled: false` or `null` once it is on | Turning it on, changing its paths and marker |
| `autoApproveOnPass` | `true` | `false` |

The refusal names each change it refused, in its message and in `fields`. Nothing else in the update is applied. Its `nextAction` is the repository's settings page in the dashboard, where a person signed in in the browser makes the change. Pass that on to the person you work for rather than trying another way.

### Rounds

- `maxAutoRounds`: automatic rounds per pull request, 1 to 50. `null` removes the limit. A repository connected through CodePanel starts at 3. The dashboard's **Review now** still runs past the limit, and a pull request's own `/rounds` setting replaces it for that pull request ([`/rounds`](/docs/commands#rounds), [Round limits](/docs/triggering-reviews#round-limits)).
- `botMaxRounds`: the most rounds in all a bot's `/rounds` comment may raise a pull request to, 0 to 50. `0` stops bots adding rounds, `null` restores the default of 5. Owners, members and collaborators are not held to it.
- `trustedBotAuthors`: up to 10 GitHub App logins, exact, such as `["my-agent[bot]"]`, whose pull requests are reviewed automatically and whose `/review` comments run like a member's. Every other bot stays skipped. A listed App's `/rounds` and `/review` stay held to `botMaxRounds`. `[]` or `null` trusts none. Adding an App reviews its open, skipped pull requests once. Only a person adds an App, in the dashboard; a token can remove one ([Merge protections](#merge-protections)). See [Trusted bot authors](/docs/triggering-reviews#trusted-bot-authors).
- `stepBackAfterRounds`: the round from which the review carries a notice to reconsider the approach. `0` turns it off, `null` restores the default of 3. It never changes the gate ([Step back](/docs/triggering-reviews#step-back)).
- `idleNudgeHours`: hours of silence before CodePanel posts one nudge comment, 0 to 23. `0` turns it off, `null` restores the default of 6 ([Idle nudge](/docs/triggering-reviews#idle-nudge)).

### `gate`

`gate` chooses which findings must be fixed or answered before the `CodePanel` commit status passes:

| Value | Must be answered |
| --- | --- |
| `critical` | Critical findings |
| `warning` | Critical findings, and warnings not rated low confidence. This is what applies when `gate` is unset |
| `all` | Every finding, suggestions and low-confidence warnings included |
| `off` | Nothing. CodePanel stops posting the status |

There is no `null`: to get the default back, send `warning`. A token can only raise the level; see [Merge protections](#merge-protections). A change reposts the status on the repository's 50 most recent pull requests at once. Older ones pick it up at their next review, answer or push. See [Gate levels](/docs/merge-gate#gate-levels).

### `reviewSwitches`

`reviewSwitches` is an object of switch names, each `true`, `false` or `null`:

- `true` or `false` sets the switch for this repository, whatever the deployment has.
- `null` removes the repository's own value, so the switch follows the deployment again.
- A name you leave out is not touched.

Passing `reviewSwitches` itself as `null` is not accepted. To clear every switch, send each name as `null`. A name outside the fourteen the schema lists is refused. When the last repository value is removed, the repository holds no switches at all. The response says what each switch now resolves to; [`get_review_switches`](/docs/mcp-server/get_review_switches) reads it without changing anything.

### `crossFamilyReview`

`crossFamilyReview` makes a round's verdict come from a model family other than the one that wrote the pull request. It is an object, or `null`:

```json
{ "crossFamilyReview": { "enabled": true, "fullLanePaths": ["convex/schema.ts", "**/billing/**"], "fullLaneMarker": "## Whiteboard defense" } }
```

- `enabled` is required. `false` keeps the setting but turns it off.
- `fullLanePaths` is optional: up to 50 globs over changed files. A pull request that changes a matching file is full lane, and its verdict also comes from a frontier model. `fullLaneMarker` does the same for a phrase or heading in the description, in any case.
- `null` clears the setting. Absent leaves it as it is. The object replaces what was stored.
- A token can turn it on but not off: `enabled: false` or `null` on a repository where it is on is refused ([Merge protections](#merge-protections)).
- When the author's family is unknown, or no other family has a working key, the round runs as configured and `payload.crossFamily` says why.

See [Cross-family verdicts](/docs/reviewers#cross-family-verdicts).

### `escalation`

`escalation` names people CodePanel asks when a finding cannot be settled by the author agent. It is an object, or `null`:

```json
{ "escalation": { "contacts": ["alice", "bob"], "triggers": ["upheld_critical", "round_limit"] } }
```

- `contacts` is 1 to 5 GitHub logins. A leading `@` is dropped, spaces are trimmed and duplicates are removed ignoring case. A value that is not a valid GitHub login is refused with `"<value>" is not a GitHub login.`, and a list outside 1 to 5 with `Escalation needs 1 to 5 GitHub logins to ask; clear it with null.`
- `triggers` is optional. Left out, it means `upheld_critical` (a critical the orchestrator upheld after the author disputed it) and `round_limit` (a critical still unanswered at the round limit). `step_back` escalates every unanswered gated finding once the step-back notice shows, warnings too. `novel` escalates what the orchestrator judges a decision for a person, and does nothing unless the `REVIEW_NOVEL_ESCALATION` switch is on. An empty list is refused.
- `null` clears the setting. Absent leaves it as it is.
- The object replaces what was stored. Sending only `contacts` resets `triggers` to the default pair.
- A token can add contacts but not remove them: a list missing a stored contact, or `null`, is refused ([Merge protections](#merge-protections)).

When a trigger fires, `nextAction` in `get_review` becomes `escalate` and names the findings, the commit status names the contacts, and one pull request comment mentions them. The author agent stops pushing and disputing for those findings until a contact answers. Escalation never changes what counts as an answer, and it does nothing while `gate` is `off`. Details are in [Escalate to a person](/docs/merge-gate#escalate-to-a-person).

### Other inputs

- `panelId`: pins the repository to one panel. `null` returns it to your default panel. An id that isn't one of your panels is refused with `Panel not found`.
- `agentFiles`: read `AGENTS.md` and `CLAUDE.md` from the base branch as review context. Off unless turned on ([Repo context](/docs/repo-context)).
- `inlineSuggestions`: also post critical and warning findings that have a checked patch as inline GitHub suggestion comments. Off by default.
- `autoApproveOnPass`: `false` stops CodePanel posting an approving GitHub review when the merge gate passes. `true` is refused with 403: it is turned on only in the dashboard, since an approval can satisfy a required review ([Auto-approve](/docs/merge-gate#auto-approve), [Merge protections](#merge-protections)).
- `autoReview`: turns automatic review on or off for the repository without disconnecting it.

Other failures: a repository that is not yours gives `Repository not found`. A round setting outside its range is refused with a sentence naming the range, for example `Automatic rounds per pull request must be a whole number from 1 to 50, or blank for no limit.`

## What it returns

`{ "ok": true, "reviewSwitches": { ... } }`. `reviewSwitches` lists every switch with:

| Field | Meaning |
| --- | --- |
| `deployment` | The deployment's value, or the switch's default while the deployment leaves it unset |
| `override` | This repository's own value, `null` for none |
| `effective` | What the repository's next round uses |
| `source` | `repository` (the override), `deployment` or `default` |

The response does not echo the other settings. Read them back with [`list_repos`](/docs/mcp-server/list_repos).

## Examples

These responses come from a test account on a local backend. The `deployment` values come from that backend's environment, not from the hosted service.

```json title="Call"
{ "repo": "codepanel-dev/web-app", "maxAutoRounds": 5, "gate": "critical" }
```

```json title="Result (trimmed to two of the fourteen switches)"
{
  "ok": true,
  "reviewSwitches": {
    "REVIEW_CACHEABLE_PROMPTS": {
      "deployment": true,
      "override": null,
      "effective": true,
      "source": "default"
    },
    "REVIEW_REVIEWER_TOOLS": {
      "deployment": false,
      "override": null,
      "effective": false,
      "source": "default"
    }
  }
}
```

The call set two fields and touched no switch, so every switch still reports `override: null`. Setting `"reviewSwitches": { "REVIEW_REVIEWER_TOOLS": true }` would turn that entry's `override` to `true` and its `source` to `repository`.

## The same step without MCP

| Surface | Form |
| --- | --- |
| CLI | `codepanel repos set <owner/name> --max-auto-rounds 5 --gate critical`, with `--escalate-to`, `--escalate-on` and `--switches NAME=on\|off\|default` for the rest ([CLI](/docs/cli#repositories)) |
| HTTP API | [`POST /repos/settings`](/docs/api#post-repossettings) with the same fields |
| Pull request comment | `/rounds` sets one pull request's limit, not the repository's ([syntax](/docs/commands#rounds)) |

## What the server tells your agent

The description your agent reads when it lists the tools:

> Turn automatic review on or off for a repository, cap its automatic review rounds per pull request, set how far bots may extend them, name GitHub Apps whose pull requests and /review comments count like a member's (trustedBotAuthors), set the round from which reviews advise stepping back (stepBackAfterRounds, 0 off), set how long a pull request waits on its author before one nudge comment (idleNudgeHours, 0 off), pin it to a specific panel (null for the default), post inline suggestion comments on the diff (inlineSuggestions), choose which findings must be answered before its CodePanel commit status passes (gate), choose whether reviews read its AGENTS.md and CLAUDE.md, set its own review switches (reviewSwitches), name people to ask about findings no agent can settle (escalation), have a model family other than the author's carry the verdict (crossFamilyReview), or turn off approving GitHub reviews when the merge gate passes (autoApproveOnPass: false). A token may tighten merge protections but not loosen them: lowering gate, adding to trustedBotAuthors, removing escalation contacts, turning crossFamilyReview off and turning autoApproveOnPass on are refused with 403, nothing in the update applied, and nextAction names the dashboard page where a person makes the change.

## Related

- [`get_review_switches`](/docs/mcp-server/get_review_switches): read the switches without changing them.
- [`list_repos`](/docs/mcp-server/list_repos): read the settings back.
- [`set_review_rounds`](/docs/mcp-server/set_review_rounds): raise or lower one pull request's limit.
- [Merge gate](/docs/merge-gate): the gate levels and escalation in full.
- [Round limits](/docs/triggering-reviews#round-limits): how rounds are counted.
- [MCP server](/docs/mcp-server#set-up-a-repository-from-an-agent): where this fits in setup.
