mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-01 06:42:06 +01:00
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - The task feed shows agent messages, documents, and artifacts. > - An agent can create a subtask or a separate follow-up task during that work. > - The reader must open the Tasks tab to find the new task. > - This pull request adds a linked task card to the source feed at creation time. > - The card shows the current title, task number, and status. > - The reader can inspect delegated work without searching a second panel. ## Linked Issues or Issue Description **What existing behavior does this improve?** Task creation visibility in the source task feed. Related work: #13823 added ancestor navigation in the Tasks panel. **Current behavior** Agent-created child tasks appear in the Tasks tab. The main feed has no persistent link card for those tasks. **Proposed behavior** Show each agent-created direct child or source-linked follow-up task once in the feed. Keep the card at creation time when status changes. Keep existing chat handoff and accepted suggestion cards without duplicates. **Reason and benefit** Readers can see which work an agent created and open that task from the conversation. **Breaking changes** None. This change uses existing authorized task reads. It does not add API or database fields. ## What Changed - Pass the existing child and source-task reads from task detail to the feed. - Add a task card with a link, wrapping title, task number, and status badge. Use existing design tokens. - Suppress repeated cards and tasks already shown by accepted suggestions or chat handoffs. - Show task-read failures with Retry. Keep the conversation readable during those failures. - Add feed and page regression cases plus desktop, multiple-task, dark, and mobile stories. Update the product description and delegation recipe. - Keep task selection and rendering in the task feed module. Existing issue APIs continue to own access checks and company scope. ## Verification - Passed: 224 focused tests with `pnpm exec vitest run ui/src/components/TaskChatThread.task-creation-order.test.tsx ui/src/pages/IssueDetail.test.tsx ui/src/components/task-detail/TaskDetailTasksPanel.test.tsx --maxWorkers=1`. - Passed: `pnpm --filter @paperclipai/ui typecheck`. - Passed: `pnpm check:token-gates`, `node scripts/check-maps.mjs`, and `node scripts/storybook-catalog.mjs`. - Cases cover creation order, current status, links, company filtering, direct children versus grandchildren, duplicate suppression, and read failure with retry. - Passed: browser render and link assertions for desktop, multiple tasks, dark theme, and mobile at 390px. All four story play phases finished. No page errors or horizontal overflow occurred. Screenshots use fixture task data and the production task feed. They do not prove server persistence or agent execution. - Passed: `pnpm --filter @paperclipai/ui build` after the concurrent memory failure. - The mobile preview frame needed spacing to contain the feed scrollbar gutter. Fixed the frame and repeated the browser checks. - Addressed the first Greptile finding: source-linked follow-ups now load with Streamlined UI off. A regression test covers that setting. - Full local build and typecheck cannot complete because Cargo is absent. The first concurrent UI build and UI typecheck were killed by the workspace memory limit. Both UI commands passed when run separately. The full local test run was stopped to fit that limit. PR CI must supply the full-suite verdict. ## Risks - Low risk. Delayed task reads can insert an older card into a loaded feed. Stable task IDs preserve the card during status updates. - New cards use the same access-checked task data as the Tasks panel. No task mutation or permission change is added. ## Model Used - OpenAI Codex, GPT-6. The runtime does not expose a more specific model ID or context size. Used reasoning, tool calls, code edits, tests, and browser automation. ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [ ] All Paperclip CI gates are green - [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge --------- Co-authored-by: Paperclip <noreply@paperclip.ing>
98 lines
5.6 KiB
Markdown
98 lines
5.6 KiB
Markdown
---
|
||
navigation: {"section":"Tasks and conversations","sectionOrder":20,"order":20}
|
||
---
|
||
|
||
# Delegation, dependencies, and signoff
|
||
|
||
A larger task can coordinate child work, dependencies, reviewers, and execution controls while preserving a clear owner and a traceable completion decision.
|
||
|
||
Feature ID: `task-coordination`.
|
||
|
||
Implementation: [task thread](../../ui/src/pages/IssueDetail.tsx), [execution policy](../../server/src/services/issues.ts).
|
||
|
||
Agent access: [companion](../agent-access-map/task-coordination.md).
|
||
|
||
## Sub-features
|
||
|
||
- `delegation`: `task-coordination/delegation` — inspect parent/child tasks and the original request behind delegated work.
|
||
- `dependencies`: `task-coordination/dependencies` — show blocking tasks and wake eligible work when prerequisites resolve.
|
||
- `signoff`: `task-coordination/signoff` — apply the configured implementation/review completion policy.
|
||
- `tree-control`: `task-coordination/tree-control` — pause or resume a task tree without bypassing its gates.
|
||
|
||
## How to get to it (user POV)
|
||
|
||
### `task-relationships`
|
||
|
||
Open the task’s parent/child and dependency links in task detail.
|
||
|
||
The task feed shows a linked card when an agent creates a direct subtask or a
|
||
follow-up task from that task. The card stays at its creation time beside
|
||
documents and artifacts. It shows the current task title, number, and status.
|
||
The Tasks tab retains the complete relationship list.
|
||
|
||
### `review-and-controls`
|
||
|
||
Inspect the task’s execution policy and available review, pause, resume, or stop controls.
|
||
|
||
## Driving it with Playwright and the Paperclip API
|
||
|
||
Preconditions: follow the [baseline](./README.md#before-driving-a-journey). Prepare a parent, child, and dependent task plus implementer/reviewer agents. Record execution policy and use a disposable tree.
|
||
|
||
Parent/dependency navigation and inherited tree holds can be checked on unassigned
|
||
tasks. Agents are required for the continuation and signoff portion. A tree pause
|
||
creates a hold; it does not change task statuses to a paused status.
|
||
|
||
### `task-relationships`
|
||
|
||
Automated: [dependency wakeups](../../server/src/__tests__/issue-dependency-wakeups-routes.test.ts) checks server behavior; visual relationship navigation remains a manual check.
|
||
|
||
The [created task card stories](../../ui/storybook/stories/task-coordination/task-created-inline.stories.tsx)
|
||
render the production feed with fixture task reads. The
|
||
[task feed tests](../../ui/src/components/TaskChatThread.task-creation-order.test.tsx)
|
||
check creation order, current status, links, and duplicate suppression.
|
||
|
||
Manual: Block one task on another, finish the prerequisite, and observe the dependent task’s eligible continuation. Follow parent/child links back to the source request. Verify no duplicate run or false parent completion occurs.
|
||
|
||
### `review-and-controls`
|
||
|
||
Automated: [execution policy](../../server/src/__tests__/issue-execution-policy.test.ts), [tree control](../../server/src/__tests__/issue-tree-control-service.test.ts), and [signoff browser suite](../../tests/e2e/signoff-policy.spec.ts) target these layers. A linked suite is not a claim that its current run is green.
|
||
|
||
Manual: Complete implementation under a review-required policy and confirm it waits for the required review outcome. Exercise rejection and later approval. Pause the parent while child work is pending, then verify resumption respects budget and ownership gates.
|
||
|
||
Resume removes the pause without changing task status. Its wake count includes only
|
||
current agent assignees on todo, in-progress, or in-review tasks. The dialog explains
|
||
that blocked, backlog, and unassigned tasks remain idle. Verify this in both task
|
||
interfaces with [the paused composer browser suite](../../tests/e2e/paused-composer.spec.ts).
|
||
Release rechecks tasks reopened after the pause; another active pause still prevents
|
||
their execution, and uncertain prior executions must be reconciled before waking.
|
||
|
||
### Plugin task panels
|
||
|
||
An installed plugin can offer an agent detail tab in the task side panel through
|
||
its optional `taskSidePanel` declaration. The launcher offers that view for the
|
||
running agent, or the task's assigned agent when idle. Manual selection mounts
|
||
the same authorized viewer used on the agent page and needs no activity event.
|
||
The view remains selectable after the run ends.
|
||
|
||
A declared activation pair controls automatic opening. The runtime captures
|
||
Runner context before use and records `runtime.activity.recorded` after success.
|
||
Core maps that namespace/activity key to the declaration and restores it from
|
||
the run log on reload or reconnect. After matching activity, readiness gets
|
||
three bounded attempts with no periodic availability poll. A ready view opens
|
||
the pane and selects its tab once per run, respecting dismissal during that run.
|
||
Declarations without a mapping support manual selection. Plugins own viewer
|
||
content, readiness, and authorization. Missing or disabled plugins add no view.
|
||
|
||
Implementation: [panel discovery](../../ui/src/hooks/useTaskPluginPanels.ts) and
|
||
[task panel](../../ui/src/components/task-side-panel/TaskSidePanel.tsx).
|
||
Automated: [discovery tests](../../ui/src/hooks/useTaskPluginPanels.test.tsx) and
|
||
[task panel tests](../../ui/src/components/task-side-panel/TaskSidePanel.test.tsx)
|
||
cover availability, task/agent changes, failures, inactivity and dismissal.
|
||
These mocks do not establish a particular plugin's live transport behavior.
|
||
|
||
## Gotchas
|
||
|
||
- Review completion and task completion are different events under some policies.
|
||
- Pausing a tree must not be “tested” by changing statuses until the screen looks quiet.
|
||
- Use [questions and approvals](./questions-and-approvals.md) for decision forms and [recovery](./recovery.md) for interrupted work.
|