Skip to content

Work on N-69 - #30

Merged
ayyshim merged 93 commits into
mainfrom
canopy/work-on-n-69
Nov 22, 2026
Merged

ayyshim merged 93 commits into
mainfrom
canopy/work-on-n-69

Conversation

@ayyshim

@ayyshim ayyshim commented Nov 22, 2026

Copy link
Copy Markdown
Owner

Handover: Work on N-69 (G-31)

What you asked for

You asked us to work on N-69, the list of 13 features that came from comparing Canopy with Coral.

I asked whether to build all 13 in this goal or only some of them. The question expired after 30 minutes with no answer, so we built all 13, in N-69's order. Tommy and Trevor each took half. At the end, each of them reviewed one half (T-205, T-206) and fixed what they found.

Since the last handover: main had moved on with PR #29 ("start stuck task") and clashed with this branch. I merged main in (T-215) and kept both pieces of stuck-task work. The branch is now level with main, so it can merge without conflicts.

What we built

All of it is on the branch canopy/work-on-n-69:

  • 93 commits and 192 files, about 13,000 lines added.
  • 14 new database migrations, numbered 00032 to 00045. None of them clash with main.
  • No commit has a Claude co-author line.

1. Stuck tasks are noticed and restarted (T-187)

  • Stuck badge: if a working agent says nothing for 15 minutes, its task gets a Stuck badge on the board. You can change the 15 minutes in the workspace panel.
  • Recovery: Canopy restarts the session once, keeping its conversation. If it's still silent after that, you get a notification and the manager gets a turn.
  • Not flagged: agents waiting on a person are skipped. Long commands, such as a 20-minute test run, send a "still busy" ping every 30 seconds, so they aren't flagged either. This was a bug found and fixed in review (T-205).
  • Works with main's fix: main's PR start stuck task #29 handles a different case: a task that never starts because a dead session blocks it. Main's fix shows the reason on the task and adds a Start now button. Ours catches an agent that started and then went silent. Both are in.

2. Low disk warning (T-188)

  • Reporting: each computer reports its free disk and memory every minute.
  • Warning: below 5 GB free, the board and the Computers page show Low disk. The level is set in the org settings, Limits tab, and 0 turns the warning off.
  • New work waits: new tasks wait on that computer with a plain message. Work that is already running isn't stopped.

3. Cost and activity analytics (T-191, T-192)

  • Analytics page: open it from the org menu on the board. It shows tokens and cost by model, effort, staff, goal, task and branch, for today, the last 7 days or the last 30 days. Admins see everyone's usage; other people see only their own.
  • Timeline tab: the task panel lists every tool call in order, with how long each took and failures marked.
  • Task cost: this was already on task cards and panels, so nothing changed there.

4. Compare output versions and comment inline (T-197, T-198)

  • Compare: in the output viewer, pick any two versions. Text shows added and removed lines; images show side by side. A new version made after a change request opens on its changes.
  • Comments: select text to comment on a passage, or use Mark an area to draw a box on an image.
  • Ask for changes: it sends the open comments to the agent, each saying where it points. You can send comments without writing a note.

5. Search and team knowledge (T-199, T-200)

  • Search box: it's in the top bar and finds goals, tasks, notes, chats and task comments. Agents get a search tool.
  • Who sees what: people only find what they can already see. A private note is found only by its author.
  • Team knowledge note: when a goal closes, Canopy rebuilds this shared note. It has one or two lines per finished goal and is capped at 3,000 characters.
  • Your additions: anything you write under the heading ## Team edits is kept on every rebuild.
  • Staff get it: the note is added to each task they start.

6. Changed files beside the chat (T-190)

  • Changes tab: it's in the task panel and in a staff member's chat window. It lists changed files with +/- counts and shows the diff.
  • Updates itself: it refreshes when the agent commits or edits a file.

7. Model and effort from the chat box (T-189)

  • Selects beside Send: only admins can change them.
  • Next turn: it uses the new settings. An idle session restarts with its conversation and the new model and effort.
  • Board: the session shows its model and effort.

8. Agents message and wait for each other (T-193, T-194)

  • New tools: message_teammate, and wait_for to wait for a reply, a task finishing, or a task's commits being merged.
  • Waking: the waiting session sleeps, and the event itself wakes it. Nothing polls. A wait times out after 60 minutes by default.
  • Board: it shows who is waiting, for example "Waiting on Wren" or "Waiting on T-3 …".

9. Sleep and wake teams (T-195)

  • Parking: idle sessions park after 3 minutes. You can change this in the workspace panel, and 0 turns parking off.
  • Waking: a parked session wakes with its conversation when work arrives, also after a hub restart.
  • Buttons:
    • "Sleep team" and "Wake team" in a manager's chat settings.
    • "Sleep all" and "Wake all" on the board's team header.
    • "Sleep all teams" and "Wake all teams" in the workspace panel.

10. Spending limits per goal (T-196)

  • Setting a limit: in Give a goal, set a token limit, a dollar limit or both.
  • At the limit: the goal pauses, its sessions sleep, and you're told. The goal shows Paused: limit reached.
  • What you can do: the goal panel has Raise the limit and continue and Stop the goal.
  • Waiting tasks: a task on a paused goal shows why it isn't starting: "This goal is paused: its spending limit is reached". I added this while merging main.
  • Fixed in review (T-206): before the fix, work went on past the limit.

11. Checks before handover (T-201)

  • Setting checks: a goal can list up to 10 check commands, such as make test.
  • Where they run: when the work is done, they run on the goal's computer in a throwaway copy of the goal branch.
  • If one fails: a "Fix the failing checks" task goes to the staff member who did the last work, and there is no handover yet.
  • If they pass: the results go into the handover.
  • After 3 failed runs: it hands over anyway, and the brief must say the checks failed.
  • Results: the Checks box in the goal panel shows each command's result and output.

12. Pull requests and CI on the board (T-202, T-204)

  • Pull request: when you approve a handover, Canopy pushes the goal branch and opens or updates its pull request. It uses gh on the goal's computer. The workspace setting "auto PR" controls this and is on by default.
  • CI status: Canopy checks it about once a minute while the pull request is open. The goal card shows CI running, CI passed or CI failed.
  • Fix it: on a failed run, the goal panel lists the failing checks and has a Fix it button that creates a fix task.

13. Goal templates and Run again (T-203)

  • Templates in Give a goal: start from a template, save the current goal as one, or update or delete one.
  • What a template holds: title, description, done when, checks, limits, manager and files. Templates are shared across the workspace.
  • Run again: on a finished goal, it opens Give a goal filled in from that goal, files included.

Where the code is

Part Where
Database hub/internal/store/migrations/00032 to 00045, queries in hub/internal/store/queries/
Hub logic hub/internal/orch/ (new files: stuck.go, resources.go, toolruns.go, waits.go, goal_limits.go, reviewcomments.go, searchtool.go, teamknowledge.go, checks.go, prci.go, changes.go)
API hub/internal/api/ (new files: analytics.go, output_comments.go, search.go, goal_checks.go, goal_templates.go), plus shared/openapi.yaml
Runner client/internal/resources/, client/internal/gitwork/ (changes.go, checks.go, pr.go), client/internal/session/ (toolruns.go, worktrees.go)
Agent tools shared/protocol/protocol.go, client/internal/tools/tools.go, hub/internal/orch/tools.go
Screens frontend/src/app/(app)/(settings)/org/analytics/, and in frontend/src/components/board/: SearchBox.tsx, outputs/CompareView.tsx, outputs/Comments.tsx, panels/ChangesView.tsx, panels/TimelineTab.tsx, panels/GoalChecks.tsx, panels/GoalLimit.tsx
Decisions docs/DECISIONS.md, new sections: teammate messages and waiting, sleeping and waking, goal templates, stuck sessions, search, "Done when" checks
System tests e2e/system/: stuck_test.go, model_test.go, waits_test.go, sleep_test.go, checks_test.go, analytics_test.go

How to check it

  1. Run the tests.
    • Run make infra, then make test, make system and make lint.
    • In frontend, run pnpm test and pnpm build. Plain pnpm couldn't read the lockfile on this machine, so the staff used npx pnpm@12.15.0.
    • The Postgres on port 5432 here belongs to another project, so the staff ran every test against a throwaway database. After the merge with main, I reran everything on that kind of database:
      • All Go tests passed with the race detector on.
      • The frontend type check, lint, 118 unit tests and build passed.
      • The full system suite passed in 2 of 3 runs. The one failure was TestGoalChecksRunOnTheRunner, which then passed 5 times on its own and in both later full runs. It looks like a timing problem, but I didn't keep its error output.
      • TestMirrorOfflineReadsAndOwnerApproval was skipped because it needs bubblewrap.
  2. Try it in the app. Run make hub and make web, then open http://localhost:8000. Don't run make gen first; see the risks below.
    • Workspace panel: find the "stuck after", idle-time and auto PR settings, and the Sleep all teams button.
    • A staff member's chat: change the effort beside Send and send a message. Check that the session on the board shows the new effort. Open the Changes tab while they work.
    • Search: search for a word from an old goal in the top-bar box.
    • Analytics: open the org menu, then Analytics.
    • Task panel: open the Timeline and Changes tabs.
    • An output with two or more versions: try Compare. Select some text and comment on it, then Mark an area on an image. Send Ask for changes with only comments.
    • Give a goal: set a small token limit, such as 20,000, and a check such as make lint. Watch the goal pause at the limit, then raise the limit. Save the goal as a template and start a new goal from it.
    • A finished goal: press Run again.
    • A repository with a GitHub remote and gh installed: approve a handover. A pull request should open, and a CI pill should appear on the goal card.
  3. Look at the screenshots. They are on T-192 (analytics), T-198 (compare and comments) and T-204 (CI on goal cards). They were made with sample data, not a running hub.
  4. See the change: git diff main...canopy/work-on-n-69.

What isn't done, and the risks

Before merging

  • Nobody has used it in a real browser, or with real GitHub. The screens were checked only by type checks, builds and screenshots with sample data. Pull requests and CI were tested with a fake gh.
  • make gen can break the board. Its type generator rewrote fields that had been added by hand to frontend/src/lib/core-types.ts. So the staff added the new types to that file by hand, and main does the same. Running make gen may remove them.
  • It's a big change to shared code. It touches goal finishing, handover approval, session start and the scheduler, which every goal uses.
  • The merge with main touched the scheduler. Main's PR start stuck task #29 rewrote how Canopy decides whether a task can start. I kept main's version and added our spending-limit pause to it. Tests pass, but it's worth a careful look in hub/internal/orch/schedule.go (startBlocker).
  • Two kinds of "stuck" on the board. Main's reason with Start now shows on a task that can't start. Our Stuck badge shows on a task whose agent went silent. They could confuse people at first.
  • One test may be flaky. TestGoalChecksRunOnTheRunner failed once under a full run and then passed 7 times.

Rough edges

  • Stuck: an agent that thinks for more than 15 minutes with no output at all is still flagged. Raising the setting is the workaround.
  • Changes tab:
    • The runner checks each live task's folder with git every 5 seconds. Nobody has measured the load with many agents.
    • Once a task ends and its computer is off, there is no saved diff to show.
  • Model and effort:
    • A chat message that is queued because you're over your usage limit loses the chosen model and effort.
    • A session in the middle of a turn keeps its old settings until it goes idle, while the board already shows the new ones.
  • Messaging:
    • There is no limit on how often an agent can message a teammate.
    • A person's chat message doesn't wake an agent waiting for a reply. Only a teammate's message does.
    • Messaging a teammate who is busy on another goal starts a separate session for them.
  • Spending limit: pausing cuts off the turn that is running. Nothing is overspent, but that turn's work is lost until the goal resumes.
  • Comments:
    • On rendered Markdown, the position of a commented passage is a best guess.
    • Passage highlights aren't drawn on the document after saving.
    • HTML prototypes can't be commented on.
  • Team knowledge: the new note has no special look in the notes list. A wrong line stays in it until someone edits it.
  • Search: someone who can see very little of the workspace may get fewer results than really match.
  • Checks:
    • Check commands run on the goal's computer as that person, outside the sandbox.
    • Anyone who starts a goal from a template with checks runs those commands on their own computer. The screen gives no warning about this yet.
  • Pull requests:
    • CI is only checked while the goal's computer is online. When it's offline, it's skipped without a message.
    • The "Fix failing CI" task goes to the manager, while the failing-checks fix goes to the staff member.
  • Templates: a goal that is queued because of usage limits doesn't copy the template's files.
  • Commits: 17 commit subjects are longer than 72 characters. We left them, rather than rewrite shared history.

What you need to decide

  1. Merge. The clash with main is fixed. Can this go to main now, or after someone has clicked through the app (step 2 of "How to check it")?

  2. Auto PR default. With the setting on, approving a handover pushes the branch to GitHub and opens a pull request with no further click. Keep it on by default, or turn it off by default?

  3. Stuck limit. Is 15 minutes right, or should the default be longer, such as 30 minutes, to allow for long thinking?

  4. Pausing at a spending limit. Should it cut off the running turn (as now), or let the turn finish and then pause, at the cost of a small overspend?

  5. Who fixes failed CI. Should the "Fix failing CI" task go to the manager (as now) or to the staff member who did the last work, like the failing-checks fix?

  6. Follow-up goal. Should we open a goal for the rough edges above? Main items:

    • a limit on how often agents can message each other;
    • person replies waking waits;
    • keeping model and effort for queued chats;
    • saved diffs after a task ends;
    • a warning on templates with checks;
    • a look for the Team knowledge note;
    • measuring the 5-second folder check;
    • looking into the flaky checks test.

    I can't hand out tasks from a handover (N-65), so any follow-up work needs a new goal on the board.

Keep both stuck task fixes. Main's start check now also waits while a goal is paused at its spending limit.
@ayyshim
ayyshim merged commit faf59ed into main Nov 22, 2026
2 checks passed
@ayyshim
ayyshim deleted the canopy/work-on-n-69 branch November 22, 2026 08:07
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.

1 participant