Skip to content

fix(platform): say why an ungranted agent cannot be the reviewer - #4132

Merged
larryro merged 1 commit into
mainfrom
fix/task-reviewer-agent-permission
Oct 3, 2026
Merged

larryro merged 1 commit into
mainfrom
fix/task-reviewer-agent-permission

Conversation

@larryro

@larryro larryro commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Problem

Choosing a project agent as a task's Reviewer failed with the generic "Choose an eligible project member or an agent in this project." when the agent simply lacked the Review other agents’ task results (task_review) grant. The picker listed every project agent with "Reviews the result from its own review task", and the door answered one code — TASK_REVIEWER_INVALID — for both "not this project's agent" and "permission missing", so the toast could not say what to fix.

Change

  • Backend — setTaskReviewer, replacePendingTaskReviewer and setProjectTaskReviewer answer TASK_REVIEWER_PERMISSION_MISSING / PROJECT_REVIEWER_PERMISSION_MISSING for a missing grant; TASK_REVIEWER_INVALID / PROJECT_REVIEWER_INVALID keep meaning an agent the project does not have.
  • Picker — the task reviewer picker greys an agent without the grant, and the project default it would inherit, with the existing tasks.reviewer.agentPermissionRequired sentence as its description (same treatment as the implementation agent). AssignableActor carries the agent's tools for it.
  • Refusals — reviewerRefusalMessage and the project's default-reviewer section map the new codes to the existing permission sentences. No new locale keys.
  • Registers — REST app-door-only code list, manual reference/error-codes.md (two rows edited, two added), new manual box PROJ-B13.

Proof

  • reviewer-picker, reviewer-refusal, task-reviewer-field, use-actor-directory, project-task-reviewer-section specs; all 85 UI spec files under app/features/{tasks,projects} green; 14 guard files green.
  • reviews.routing.test.ts (split codes for agentTools: [] vs. a missing agent), service.reviewer.test.ts, rest/error-codes.test.ts green.
  • Review-routing integration lane on a throwaway Postgres + MinIO: 65/65, including task=400/TASK_REVIEWER_PERMISSION_MISSING, project=400/PROJECT_REVIEWER_PERMISSION_MISSING.
  • Live dev stack (frontend only — the backend needs a bun dev restart): the picker on the reporting task lists the implementation agent and the ungranted agent greyed, each with its reason; people stay selectable.
  • typecheck, platform lint, format:check, lint:manual, check-guide on suites/projects.md green.

Choosing a project agent as a task's reviewer failed with the generic
"Choose an eligible project member or an agent in this project" when the
agent simply lacked the task_review tool: the picker listed every project
agent, and the door answered one code for "not this project's agent" and
"permission missing".

- setTaskReviewer, replacePendingTaskReviewer and setProjectTaskReviewer
  answer TASK_REVIEWER_PERMISSION_MISSING / PROJECT_REVIEWER_PERMISSION_MISSING
  for a missing grant; TASK_REVIEWER_INVALID / PROJECT_REVIEWER_INVALID keep
  meaning an agent the project does not have.
- The task reviewer picker greys an agent without the grant — and the
  project default it would inherit — with the existing permission sentence;
  AssignableActor carries the agent's tools for it.
- The refusal toasts map the new codes to the existing permission sentences
  (no new locale keys).
- Registered in the REST app-door-only code list and the manual error-code
  register; new manual box PROJ-B13; routing unit test and the review-routing
  integration lane assert the split codes.
@larryro
larryro merged commit f74dc49 into main Oct 3, 2026
@larryro
larryro deleted the fix/task-reviewer-agent-permission branch October 3, 2026 12:29
@yannickmonney

Copy link
Copy Markdown
Contributor

Post-merge independent review of #4132 at f74dc492c: larryro merged it at 12:29:17Z with no review on record. Tale agent #2 3f9fdcee, TALE-359 run dea040d6-b37f-49a1-a4a0-fdef67ce4ee8. I didn't author it. This is a source review by one read-only reviewer, cross-checked by me. I didn't execute anything.

Verdict: source accepted with LOW follow-ups. No check is weaker and nothing new is disclosed.

  • agentReviewerEligibility is unchanged. Every non-eligible result still throws before any write, in all three doors (tasks/service.ts:2022-2031, projects/service.ts:965-977, tasks/reviews.ts:814-829).
  • The lookup stays scoped to org and project. The picker only reuses agent tools that any project reader already gets from listProjectAgents.
  • The codes are app-only (rest/error-codes.test.ts). They are mapped in reviewer-refusal.ts and the project section, and their EN/DE/FR keys already existed.
  • CI's integration lane covers both codes (agent-review-routing.integration.ts:224-228,416-423).

LOW

  1. Stale manual totals. tests/manual/readme.md:53 says 61 PROJ boxes; suites/projects.md now has 62. readme.md:32 says 1082 boxes; there are 1083. lint:manual doesn't check totals.
  2. New box PROJ-B13 can't be run as written (suites/projects.md:454). "Make the ungranted agent the project's Default reviewer" is exactly the save the backend refuses with PROJECT_REVIEWER_PERMISSION_MISSING (projects/service.ts:960-971). Reword it to: grant, save the default, then revoke the grant.
  3. The project section's new mapping has no test (project-task-reviewer-section.tsx:63-69). Its test file has no error-code cases.

INFO

  • The 409 TASK_REVIEWER_PERMISSION_MISSING branch (reviews.ts:824-825) can't be reached from its only caller. error-codes.md:38 lists only the 400.
  • An agent that is both the implementer and ungranted gets PERMISSION_MISSING from the server, while the picker says "not independent". Both are true.
  • The agent list may stay stale for a moment after a revoke, until the project hint arrives.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants