Skip to main content
Glama

aiworkhub_agent_accept_review

Accept a review-ready request by revalidating scope, hashes, and gates, then promote the retained worktree into the canonical repo; failures leave the repo untouched.

Instructions

COORDINATOR/WRITE-GATED: accept one review_ready request, phase 2.

Re-runs scope, required-output, and validation gates against the retained isolated worktree, compares every changed path's hash against the ones recorded when the request first reached review, and only then promotes into the canonical repo and finalizes the task as done. Any precondition or revalidation failure leaves the canonical repo untouched and the task in review. Idempotent: accepting the same already-finished request again returns already_accepted instead of re-promoting. Medium-and-higher risk profiles also validate a fresh canonical+candidate combined tree and require strict reviewer findings; high/critical review requires an explicit confirm_high_risk decision.

manager_correction -- unset by default, and every other behaviour is then exactly as before -- accepts the sealed candidate PLUS a manager patch instead of rejecting it: {"patch": <unified diff>, "finding_ids": [<id>, ...], "reason": str, "allowed_writes_amendment": [<path>, ...], "manager_measured": {...}} (allowed_writes_amendment and manager_measured are optional). Each finding_ids entry is one of: reviewer:<lens>:<id> -- lifts the refinement_required blocker of a reviewer finding that aiworkhub_manager_review_finding_dispose recorded as confirmed and that is not blocking; manager:<repo-relative path>@<sha256> -- evidence the manager's own gate or test run measured, in .scratch/ or .aiworkhub/runtime/ of the canonical repo; it lifts no finding, it only lets the correction ride instead of a rework round; validation:<index> -- for a validation_failed candidate, the failed declared-validation row it repairs; a row that did not fail is refused by name. manager_measured is {"command": str, "failing_output": str}, both non-empty and capped at 1000 and 4000 characters, for a failure the manager measured itself, such as a red neighbour or validation test no reviewer flagged. It lifts no reviewer blocker and lets finding_ids be empty; its canonical-JSON sha256 is recorded as manager_measured_sha256. Any other shape refuses manager_measured_invalid. The patch is validated before any promotion or state change and refuses with manager_correction_invalid:<reason> when the manager is unverified, the patch does not apply to the sealed candidate bytes, a touched path is outside the card's allowed_writes or not part of the candidate, no finding is named and no manager_measured is given, or a named finding is unconfirmed or blocking. The declared validations and the mechanical gate then run on the CORRECTED bytes, those are the bytes promoted, and the accepted-outcome receipt binds the patch digest with the candidate and corrected hashes. An optional "allowed_writes_amendment": [<repo-relative path>, ...] (NF-2026-02241) lets the patch also touch those exact paths, e.g. a neighbour test the accept revalidation showed red (a red neighbour can also be corrected via manager_measured). Every amended path must be touched by the patch and obey the allowed_writes path rules (allowed_writes_amendment_* refusals otherwise); a path outside the candidate is patched against its canonical bytes and promoted with it. After the accept lands the paths are added to the card's allowed_writes, add-only, and the reply names them under allowed_writes_amendment. Without the key a path outside allowed_writes is refused as before.

A successful reply is the receipt (aiworkhub.accept_review_receipt.v1): promoted_paths, reviewer_finalization, acceptance_evidence_record, accepted_outcome_receipt, needfix_closure, learning_commit_owed, plus the finalized card's status and card_sha256/card_bytes. include_card = none (default) | summary | full adds the card view. Errors are unchanged.

lesson_candidate / no_new_lesson_reason -- both unset by default, and the reply is then exactly as before -- close this decision's learning out in the same call, AFTER the accept landed. lesson_candidate (with optional promote_ai_memory and extra_evidence_ids) runs aiworkhub_manager_learning_commit for this request and returns its reply under learning_commit; no_new_lesson_reason (one of learning_commit_store.NO_NEW_LESSON_REASONS) records that disposition and returns it under learning_disposition. Both together (learning_inline_conflict), an unknown reason, or promote_ai_memory without a lesson are refused before anything changes. A failed close-out never undoes the accept: ok stays true, the failure is reported under its own key, and learning_commit_owed stays in the reply.

commit (accept_commit) is {state: committed|skipped|failed, sha?, reason?, paths, message_subject}; a skip or failure never undoes the accept.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "request_id": "<request_id>",
      "task_id": "<task_id>"
    },
    "name": "aiworkhub_agent_accept_review"
  }
}

Input Schema

NameRequiredDescriptionDefault
task_idYesId of the task card that request belongs to.
request_idYesId of the worker request to accept; it must be in review_ready state.
auto_commitNoDefault true: after a successful accept, git-commit exactly the receipt's promoted_paths (hooks run; never amend, push or --no-verify) and report it under commit; false leaves the commit to you.
include_cardNonone (default), summary or full; adds that view of the finalized card to the reply.none
risk_signalsNoExtra risk signals to add to those derived from the candidate diff; they can only tighten review.
commit_messageNoCommit message to use instead of the generated "<fix|feat>(<topic>): <title>"; the Resolves/AIWorkHub-Task/AIWorkHub-Request and aiworkhub.commitTrailer trailers are still appended.
lesson_candidateNoLesson text to commit for this decision in the same call, after the accept lands; omit to commit the lesson separately.
reviewer_reportsNoOptional reviewer report objects; normally omitted because acceptance verifies reviewer receipts by request id (see reviewer_request_ids).
confirm_high_riskNoSet true to give the explicit human approval that high or critical risk tiers require; default false.
promote_ai_memoryNoSet true together with lesson_candidate to also promote the lesson to AI memory; refused without a lesson. Default false.
extra_evidence_idsNoAdditional evidence ids to cite with the lesson; only used together with lesson_candidate.
manager_correctionNoAccept the sealed candidate plus a manager patch: {"patch": <unified diff>, "finding_ids": ["reviewer:<lens>:<id>", ...], "reason": str, "allowed_writes_amendment": [<exact repo-relative path>, ...] (optional; each must be touched by the patch and is added to the card's allowed_writes once the accept lands)}; omit for a plain accept.
requested_risk_tierNoRisk tier to review at; omit to use the tier the finalizer measured for this candidate. An explicit value can only raise the tier, never lower it.
no_new_lesson_reasonNoInstead of a lesson, record why none is owed: duplicate_of_recorded_lesson, no_generalizable_cause, mechanical_change_only, evidence_insufficient or decision_not_about_code; refused together with lesson_candidate.
reviewer_request_idsNoReviewer request ids to verify; omit to use every verified reviewer bound to this request and task, and pass [] to exclude all reviewers.
confirm_destructive_changeNoSet true to accept a candidate whose diff failed a destructive-change check; otherwise accept is refused with destructive_diff_requires_manager_confirmation. Default false.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.12.98
    • changedInput schema / properties / manager_correction / description
      Previous value: -"Accept the sealed candidate plus a manager patch: {\"patch\": <unified diff>, \"finding_ids\": [\"reviewer:<lens>:<id>\", ...], \"reason\": str}; omit for a plain accept."New value: +"Accept the sealed candidate plus a manager patch: {\"patch\": <unified diff>, \"finding_ids\": [\"reviewer:<lens>:<id>\", ...], \"reason\": str, \"allowed_writes_amendment\": [<exact repo-relative path>, ...] (optional; each must be touched by the patch and is added to the card's allowed_writes once the accept lands)}; omit for a plain accept."
  2. Changed2 schema fields changedv0.12.72
    • addedInput schema / properties / auto_commit
      Added value: +{
      +  "default": true,
      +  "description": "Default true: after a successful accept, git-commit exactly the receipt's promoted_paths (hooks run; never amend, push or --no-verify) and report it under commit; false leaves the commit to you.",
      +  "title": "Auto Commit",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / commit_message
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Commit message to use instead of the generated \"<fix|feat>(<topic>): <title>\"; the Resolves/AIWorkHub-Task/AIWorkHub-Request and aiworkhub.commitTrailer trailers are still appended.",
      +  "title": "Commit Message"
      +}
  3. Changed14 schema fields changedv0.12.67
    • addedInput schema / properties / confirm_destructive_change / description
      Added value: +"Set true to accept a candidate whose diff failed a destructive-change check; otherwise accept is refused with destructive_diff_requires_manager_confirmation. Default false."
    • addedInput schema / properties / confirm_high_risk / description
      Added value: +"Set true to give the explicit human approval that high or critical risk tiers require; default false."
    • addedInput schema / properties / extra_evidence_ids
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Additional evidence ids to cite with the lesson; only used together with lesson_candidate.",
      +  "title": "Extra Evidence Ids"
      +}
    • addedInput schema / properties / include_card / description
      Added value: +"none (default), summary or full; adds that view of the finalized card to the reply."
    • addedInput schema / properties / lesson_candidate
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Lesson text to commit for this decision in the same call, after the accept lands; omit to commit the lesson separately.",
      +  "title": "Lesson Candidate"
      +}
    • addedInput schema / properties / manager_correction / description
      Added value: +"Accept the sealed candidate plus a manager patch: {\"patch\": <unified diff>, \"finding_ids\": [\"reviewer:<lens>:<id>\", ...], \"reason\": str}; omit for a plain accept."
    • addedInput schema / properties / no_new_lesson_reason
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Instead of a lesson, record why none is owed: duplicate_of_recorded_lesson, no_generalizable_cause, mechanical_change_only, evidence_insufficient or decision_not_about_code; refused together with lesson_candidate.",
      +  "title": "No New Lesson Reason"
      +}
    • addedInput schema / properties / promote_ai_memory
      Added value: +{
      +  "default": false,
      +  "description": "Set true together with lesson_candidate to also promote the lesson to AI memory; refused without a lesson. Default false.",
      +  "title": "Promote Ai Memory",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / request_id / description
      Added value: +"Id of the worker request to accept; it must be in review_ready state."
    • addedInput schema / properties / requested_risk_tier / description
      Added value: +"Risk tier to review at; omit to use the tier the finalizer measured for this candidate. An explicit value can only raise the tier, never lower it."
    • addedInput schema / properties / reviewer_reports / description
      Added value: +"Optional reviewer report objects; normally omitted because acceptance verifies reviewer receipts by request id (see reviewer_request_ids)."
    • addedInput schema / properties / reviewer_request_ids / description
      Added value: +"Reviewer request ids to verify; omit to use every verified reviewer bound to this request and task, and pass [] to exclude all reviewers."
    • addedInput schema / properties / risk_signals / description
      Added value: +"Extra risk signals to add to those derived from the candidate diff; they can only tighten review."
    • addedInput schema / properties / task_id / description
      Added value: +"Id of the task card that request belongs to."
  4. First observedv0.1.0

TDQS

A4.4/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations only say readOnlyHint=false, destructiveHint=false and openWorldHint=false; the description goes far beyond that by disclosing atomicity ("any precondition or revalidation failure leaves the canonical repo untouched and the task in review"), idempotency ("already_accepted"), specific refusal codes, git commit side effects with hooks and no-amend/push rules, and that a failed learning close-out never undoes the accept. This is exactly the mutation-safety context an agent needs before invoking a write tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose is correctly front-loaded in the first two sentences, but the body is a very long dense block where manager_correction, allowed_writes_amendment and lesson close-out are interleaved rather than clearly sectioned. There is filler ("Errors are unchanged.") and near-duplicated framing of the unset-by-default pattern, and the receipt field list partly restates what the output schema already provides.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 16-parameter, high-stakes mutation tool with an output schema, the description covers preconditions, failure semantics, side effects including the post-accept git commit, and the ordering of the optional learning close-out, which is enough to call it correctly. The remaining gaps are minor: it does not say what an agent should do on a refusal (e.g. fall back to reject-review or a rework round) and does not point at the preview step.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3, but the description adds real meaning the schema cannot: manager_correction is only typed as an open object, and the prose defines its patch/finding_ids/reason/allowed_writes_amendment/manager_measured shape, the three finding_id formats, string caps, and the refusal conditions. It also clarifies cross-parameter interactions (lesson_candidate with no_new_lesson_reason is refused; promote_ai_memory without a lesson is refused) that the flat schema leaves implicit.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening line gives a specific verb and resource ("accept one review_ready request, phase 2") and then states the concrete effect: re-run gates, compare path hashes, promote into the canonical repo, and finalize the task as done. An agent can tell this is the terminal accept step rather than a review/inspection tool, and the "phase 2" framing plus coordinator gating separates it from the preview-style siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Preconditions are explicit (request must be in review_ready state; only coordinator/write-gated callers; high/critical tiers require confirm_high_risk) and conditional modes are described precisely (manager_correction set vs unset, lesson_candidate vs no_new_lesson_reason, commit behaviour). What is missing is any direct routing statement toward a sibling — it never says to run aiworkhub_agent_accept_preview first or to use aiworkhub_task_reject_review instead when the candidate should not land.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools