Skip to main content
Glama

aiworkhub_agent_accept_review

Accept a review-ready request by revalidating gates and hashes, then promote the verified changes into the canonical repo. Failures leave the repo untouched and the task in review.

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": ["reviewer:<lens>:<id>", ...], "reason": str}. It lifts the refinement_required blocker of each named finding that a selected reviewer reported and aiworkhub_manager_review_finding_dispose already recorded as confirmed, provided its severity is not blocking. 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, 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. 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.2/5.0
Behavior5/5

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

Annotations only declare readOnly=false, destructive=false, openWorld=false; the description adds the real substance: atomicity guarantees, idempotent re-accept returning already_accepted, hash revalidation of retained worktree paths, risk-tier confirmation requirements, and the manager_correction refusal catalogue. It also discloses post-accept side effects (git commit of promoted_paths, learning close-out) that annotations do not cover.

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?

The operation and its atomicity are front-loaded, but the body is a dense multi-paragraph block mixing three optional modes (manager_correction, lesson close-out, commit) with unusual double-backtick markup and emphatic casing. Every paragraph is substantive, yet the wall-of-text presentation makes scanning and mode separation harder than necessary.

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

Completeness5/5

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

For a 16-parameter, write-gated coordinator tool with an output schema, the description covers preconditions, promotion semantics, refusal outcomes, optional-mode interactions, and receipt contents in enough depth that an agent could call it correctly without reading source.

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 coverage is 100%, so the baseline would be 3; the description earns above that by explaining effects the schema cannot, e.g. that manager_correction re-runs validations on the CORRECTED bytes and binds the patch digest into the receipt, and that allowed_writes_amendment is add-only on the card. Some parameters (reviewer_reports, risk_signals) are left to the schema text alone.

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

Purpose4/5

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

Names a specific verb and resource ('accept one review_ready request') and scopes it as 'phase 2', which implicitly separates it from aiworkhub_agent_accept_preview. It never names that sibling explicitly or states the ordering rule ('run preview first'), so the differentiation is inferred rather than spelled out.

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?

Gives a clear triggering condition ('request must be in review_ready state'), explicit failure semantics ('any precondition or revalidation failure leaves the canonical repo untouched'), and idempotency behavior. What it lacks is an explicit statement of when NOT to use it versus rejection/hold siblings such as aiworkhub_task_reject_review.

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