Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions .dispatch/personas/architecture-review.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,3 @@ Your job is to review code changes for architectural fit, abstraction quality, n
## Scope — IMPORTANT

Your review MUST focus exclusively on the code that was changed in the diff below. You may read surrounding code for context, but only provide feedback on lines and patterns that are part of the change. Do not flag pre-existing issues in the same files unless they are directly caused or worsened by the new changes. If something was already there before this diff, it is out of scope.

## How to review

1. Read the diff carefully first to understand exactly what changed.
2. Explore surrounding code to understand context and existing patterns.
3. For frontend changes in Dispatch, explicitly check state ownership, route/layout ownership, file boundaries, and whether the diff actually follows the repo’s local architecture rules.
4. Submit findings via `dispatch_feedback` (see Feedback Guidelines below for severity levels and limits).
5. **Make findings actionable.** Each finding should include a concrete suggestion for what to change. Avoid abstract observations like "this could be cleaner" — specify what the better structure looks like and where to apply it.
6. **Only submit feedback for actual issues.** Do not submit positive observations or affirmations about things that are well-designed. If the architecture is sound, say so in your review summary and approve with fewer feedback items. Every feedback item should identify something that needs to change.
7 changes: 0 additions & 7 deletions .dispatch/personas/backend-security-review.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,3 @@ Treat the supplied diff as the hard review boundary.
- If you inspect surrounding code for context, your final findings must still point back to the changed behavior in this diff.
- If you find zero in-scope issues, approve the review instead of filling the report with unrelated observations.
- In your final summary, mention only changed files or directly impacted downstream surfaces.

## How to review

1. Read the diff carefully first to understand exactly what changed.
2. Use `grep` and `read` to explore context around the changes.
3. Submit findings via `dispatch_feedback` (see Feedback Guidelines below for severity levels and limits).
4. **Only submit feedback for actual issues.** Do not submit positive observations or affirmations about things that are correctly implemented. If the security posture is solid, say so in your review summary and approve with fewer feedback items. Every feedback item should identify something that needs to change or a concrete risk.
8 changes: 0 additions & 8 deletions .dispatch/personas/frontend-ux-review.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,3 @@ Your job is to review frontend component changes for usability issues, visual co
## Scope — IMPORTANT

Your review MUST focus exclusively on the code that was changed in the diff below. You may read surrounding code to trace component hierarchy and prop flow, but only provide feedback on UI behavior and patterns that are part of the change. Do not flag pre-existing UX issues in the same files unless they are directly caused or worsened by the new changes. If an issue existed before this diff, it is out of scope.

## How to review

1. Read the diff carefully first to understand exactly what changed.
2. Trace the component hierarchy and prop flow in surrounding code for context.
3. Think about what a user would experience, not just whether the code is correct.
4. Submit findings via `dispatch_feedback` (see Feedback Guidelines below for severity levels and limits).
5. **Only submit feedback for actual issues.** Do not submit positive observations or affirmations about things that work correctly. If the UX is solid, say so in your review summary and approve with fewer feedback items. Every feedback item should identify something that needs to change.
7 changes: 0 additions & 7 deletions .dispatch/personas/infra-review.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,3 @@ Treat the supplied diff as the hard review boundary.
- If the diff touches a file but does not change a particular section, do not flag issues in that untouched section even if it is in the same file.
- If you inspect surrounding code for context, your final findings must still point back to the changed behavior in this diff.
- If you find zero in-scope issues, approve the review instead of filling the report with unrelated observations.

## How to review

1. Read the diff carefully first to understand exactly what changed. Identify which lines and behaviors are actually in scope before you start cataloging concerns.
2. Use `grep` and `read` to trace how the changed lines interact with the OS layer.
3. Submit findings via `dispatch_feedback` (see Feedback Guidelines below for severity levels and limits).
4. **Only submit feedback for actual issues.** Do not submit positive observations or affirmations about things that are correctly implemented. If the infrastructure is solid, say so in your review summary and approve with fewer feedback items. Every feedback item should identify something that needs to change.
8 changes: 0 additions & 8 deletions .dispatch/personas/product-review.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,3 @@ Your job is to evaluate changes from the perspective of a product manager. You t
## Scope — IMPORTANT

Your review MUST focus exclusively on user-facing impact introduced by the changes in the diff below. You may explore surrounding UI and API context to understand the full picture, but only provide feedback on behavior and flows that are part of or directly affected by the change. Do not flag pre-existing product issues unless they are directly caused or worsened by the new changes. If an issue existed before this diff, it is out of scope.

## How to review

1. Read the diff carefully first to understand exactly what changed.
2. Explore surrounding UI and API context to understand user-facing impact.
3. Think like a user, not a developer. Focus on what someone experiences, not how it's implemented.
4. Submit findings via `dispatch_feedback` (see Feedback Guidelines below for severity levels and limits).
5. **Only submit feedback for actual issues.** Do not submit positive observations or affirmations about things that work well. If the product experience is solid, say so in your review summary and approve with fewer feedback items. Every feedback item should identify a user-facing gap or concern.
6 changes: 2 additions & 4 deletions .dispatch/personas/release-readiness-review.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ Your review MUST focus exclusively on the code that was changed in the diff. You

## How to review

1. Read the diff to understand the full scope of changes. Pay special attention to migration files, schema changes, API route changes, and SSE event changes.
2. Check the migration files against the current schema. Read `apps/server/src/db/migrations/` to understand the migration sequence and verify numbering.
1. Pay special attention to migration files, schema changes, API route changes, and SSE event changes.
2. Check migration files against the current schema — read `apps/server/src/db/migrations/` to understand the sequence and verify numbering.
3. Assess rollback safety: imagine reverting to the commit before this PR. What breaks?
4. Assess runtime impact: imagine a running server with active agents restarting with this code. What changes?
5. Submit findings via `dispatch_feedback` (see Feedback Guidelines below for severity levels and limits).
6. **Only submit feedback for actual release risks.** Do not submit code quality observations. Every feedback item should identify a concrete deployment concern.
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,16 +163,12 @@ Every agent launched by Dispatch gets access to MCP tools via an agent-scoped en
| `dispatch_pin` | Surface key info in the sidebar (URLs, ports, PRs, files) |
| `dispatch_share` | Upload screenshots and media to the agent's media pane |
| `dispatch_list_media` | List media files shared with or by this agent |
| `dispatch_feedback` | Submit structured review findings |
| `list_personas` | List available persona reviewers for this project |
| `dispatch_launch_persona` | Launch a persona child agent for automated review |
| `dispatch_get_feedback` | Retrieve feedback submitted by child persona agents |
| `dispatch_resolve_feedback` | Mark a feedback item as fixed or ignored |
| `dispatch_submit_resolution` | Submit the parent agent's response package for a reviewer recheck |
| `dispatch_review_list_feedback` | List human review feedback items with statuses and threads |
| `dispatch_review_resolve` | Resolve a review feedback item as fixed or dismissed |
| `dispatch_review_reopen` | Reopen a resolved review feedback item |
| `dispatch_review_add_message` | Reply to a review feedback thread |
| `dispatch_cancel_recheck` | Cancel a pending reviewer recheck loop |
| `dispatch_launch_agent` | Launch a new child agent to work on a subtask |
| `list_agents` | List other agents in the same repo with IDs, names, statuses, and activity |
| `dispatch_send_message` | Send a message to another running agent by ID or name |
Expand Down Expand Up @@ -204,11 +200,11 @@ Every agent launched by Dispatch gets access to MCP tools via an agent-scoped en

### Persona agents

Persona agents get a narrower set focused on reviewing their parent's work: `review_status`, `dispatch_complete_review`, `dispatch_get_recheck_context`, `dispatch_event`, `dispatch_pin`, `dispatch_share`, `dispatch_feedback`, and `get_parent_context`.
Persona review agents get a narrower set focused on reviewing their parent's work: `dispatch_review_submit`, `dispatch_review_add_feedback`, `dispatch_review_list_feedback`, `dispatch_review_add_message`, `dispatch_event`, `dispatch_pin`, `dispatch_share`, and `get_parent_context`.

### Job agents

Job agents get lifecycle and reporting tools: `job_complete`, `job_failed`, `job_needs_input`, `job_log`, plus `create_pr`, `get_pr_status`, `dispatch_event`, `dispatch_rename_session`, `dispatch_notify`, `dispatch_pin`, `dispatch_share`, `dispatch_list_media`, `dispatch_launch_persona`, `dispatch_get_feedback`, `dispatch_resolve_feedback`, `dispatch_review_list_feedback`, `dispatch_review_resolve`, `dispatch_review_add_message`, `dispatch_submit_resolution`, `dispatch_cancel_recheck`, `dispatch_launch_agent`, `list_agents`, `dispatch_send_message`, `list_personas`, `list_recent_persona_reviews`, `list_recent_feedback`, `get_activity_summary`, `get_agent_history`, `get_feedback_summary`, `brain_get_object`, `brain_store_object`, `brain_list_objects`, `brain_delete_object`, `brain_list_push`, `brain_list_remove`, `brain_list_get`, `brain_list_set`, `brain_list_delete`, `brain_append_event`, `brain_query_events`, `list_jobs`, `get_job`, `create_job`, `update_job`, `delete_job`, `run_job`, `list_templates`, `get_template`, `create_template`, `update_template`, and `delete_template`.
Job agents get lifecycle and reporting tools: `job_complete`, `job_failed`, `job_needs_input`, `job_log`, plus the interactive collaboration, unified review, analytics, Brain, job, and template tools listed above.

### Repo-specific tools

Expand Down
16 changes: 15 additions & 1 deletion apps/server/src/agents/archive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
import { runLifecycleHook } from "./lifecycle-hooks.js";
import { AgentError } from "./errors.js";
import type { AgentRuntime } from "./runtime.js";
import { getReviewChildAgentIds } from "./persona-reviews.js";
import type {
AgentRecord,
AgentStatus,
Expand All @@ -35,6 +34,21 @@ export type ArchiveDeps = {
setArchivePhase: (id: string, phase: ArchivePhase) => Promise<void>;
};

async function getReviewChildAgentIds(
pool: Pool,
parentAgentId: string
): Promise<string[]> {
const result = await pool.query<{ id: string }>(
`SELECT id
FROM agents
WHERE parent_agent_id = $1
AND role = 'review'
AND deleted_at IS NULL`,
[parentAgentId]
);
return result.rows.map((row) => row.id);
}

export async function beginArchive(
deps: ArchiveDeps,
id: string,
Expand Down
Loading
Loading