Skip to content

[DEV-108] Make dashboard status data trustworthy: show branch & harness on runs, fix false 'worker stopped', and list open agent PRs with links - #102

Merged
danii1 merged 4 commits into
mainfrom
feature/dev-108
Sep 1, 2026
Merged

[DEV-108] Make dashboard status data trustworthy: show branch & harness on runs, fix false 'worker stopped', and list open agent PRs with links#102
danii1 merged 4 commits into
mainfrom
feature/dev-108

Conversation

@danii1

@danii1 danii1 commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Task: DEV-108

Summary: Make dashboard status data trustworthy: show branch & harness on runs, fix false 'worker stopped', and list open agent PRs with links

Implementation Details

Now let me look at the dashboard-ui package structure:
Let me look at the branch creation and harness resolution flow in index.ts:
I have a good picture now. Let me set up a task list and study the remaining files:
Let me check a few more details — the test setup, agent-harness resolveHarness, and worker docs:
Now let me see the rest of the review-polling tests to make sure the reconciler integration won't break them:
The picture is clear. Let me check a few last implementation details:
Now I'll implement. Starting with the new agent PR reconciler module:
Now update review-polling-acquirer.ts to use the reconciler (shared fetch, gone handling):
Now the tick() and pollPr() methods:
Let me fix a leftover artifact in that edit and properly log closures:
Now add the isGitHubNotFound helper to github-reviews.ts:
Now update the workspace-worker's fetchPr adapter to map 404s to gone:
Now run-recorder.ts — add branch recording:
Now wire it into index.ts — harness at beginRun, branch after creation:
Now address-review.ts — record the harness on pr_mention runs:
Now lock-manager.ts — support plain-dir locks and expose the lock file path:
Now dashboard-api.ts — worker liveness and the agent PRs endpoint:
Now the worker-status handler rewrite:
Now the server route in dashboard-server.ts:
Now the dashboard-ui. First the API types:
Now the StatusStrip with three liveness states and a PR-count link:
Now the new PRs view:
Wire the route and tab in App.tsx:
Now add the Branch column to the runs list:
Now the reconciler tests:
Now update the dashboard-api tests:
Now add lock-manager tests for the plainDir option:
Add reconciliation tests to the review-polling test suite:
Add setRunBranch tests to the run-recorder suite:
Now the dashboard-ui tests:
Now let's verify — typecheck and run the affected tests:
The auth failure looks like a missing install in this worktree. Let me install dependencies first:
Typecheck passes. Now run the affected test suites:
The COALESCE order was inverted — fix setRunBranch to true no-clobber semantics:
Now the full code package test suite:
All code tests pass. Now the dashboard-ui tests:
All green. Now lint and format:
Lint warnings are pre-existing. Now format:
Format is stable. Now verify the full build works:
Build passes. Now update the docs:
Let me do a careful self-review of the final diff:
Let me check worker.md for a natural place to mention reconciliation:
Final verification — full test suites, typecheck, lint:
All checks pass. Final diff summary:
DEV-108 is implemented and fully verified (typecheck, lint, format, build, 1072 code tests + 64 UI tests pass).

What changed

1. Runs record harness & branch (packages/code/src/index.ts, run-recorder.ts, address-review.ts)

  • beginRun now records harness: resolvedAgent.harness.name for task/scheduled runs; pr_mention runs (address-review.ts:488) record it too. Conflict-resolution runs already did.
  • New RunStore.setRunBranch + recordRunBranch() attach the actual branch after createFeatureBranch succeeds (it can gain an -attempt-N suffix). COALESCE semantics never clobber a branch recorded at run start.
  • Runs list gains a Branch column; existing runs degrade to .

2. Worker liveness is truthful (dashboard-api.ts, lock-manager.ts, StatusStrip.tsx)

  • GET /api/worker now returns worker: { status: "running" | "stopped" | "unknown", pid?, startedAt?, lockFile? }.
  • Lock lookup checks the project's .devintern-code/.worker.lock and the workspace home's .worker.lock (fleet/launchd mode — the false "stopped" case). Dead pid → stopped; no lock anywhere → explicit "worker status unknown" instead of claiming stopped.

3. Agent PR count reconciled with GitHub (agent-pr-reconciler.ts new, review-polling-acquirer.ts, workspace-worker.ts)

  • Each tick, reconcileOpenAgentPrs() conditionally GETs every watched PR (reusing the shared github:pr: ETag cursors — 304s are rate-limit-free, honoring the App-vs-PAT note) and closes registry rows whose PR is closed/merged or gone (404 → renamed/transferred/deleted, mapped via new isGitHubNotFound).
  • The fetched result is shared with the per-PR poll loop (one fetch per PR per tick, no double API cost), so a PR closed outside the worker drops from the count within one poll cycle. Failures/rate limits never close rows.

4. Open PRs listed with links (/api/agent-prs + new PRs view)

  • New endpoint returns repo, PR number, GitHub URL, branch, ticket key (linked via tracker config), and age.
  • New PRs tab + AgentPrsView table; the header's "N agent PRs open" now links to it.

Tests & docs: new agent-pr-reconciler.test.ts, plus coverage for plainDir lock reads, 3-state worker status, workspace fallback, /api/agent-prs end-to-end, gone-PR unwatching, shared-fetch accounting, formatAge, and UI components. docs/code/dashboard.md and worker.md updated.


This PR was automatically created by @devintern/code

…w branch & harness on runs, fix false 'worker stopped', and list open agent PRs with links
@danii1 danii1 added the devintern-authored Pull request written by DevIntern working its own backlog label Aug 29, 2026
Ticket links on /api/agent-prs were re-derived at read time from the
dashboard process's own TASK_TRACKER env, so switching the task tracker
(or running the dashboard standalone without tracker env) broke or
mislinked existing PRs.

Instead, the worker now derives the ticket URL when the PR is created
(in recordAgentPrFromUrl, where the project's tracker config is loaded)
and persists it in a new agent_prs.ticket_url column (additive migration
following the runs table pattern). The dashboard replays the stored URL
verbatim; listOpenAgentPrs reads with SELECT * so a readonly dashboard
still lists PRs from databases predating the column.
@danii1 danii1 closed this in #104 Aug 31, 2026
@danii1 danii1 reopened this Aug 31, 2026
# Conflicts:
#	docs/code/dashboard.md
#	packages/code/src/lib/review-polling-acquirer.ts
@danii1

danii1 commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

🔀 This branch had merge conflicts with main; devintern resolved them and pushed the merge. Please double-check the resolution.

resolveWorkerStatus checked the project-dir lock first and returned it
whenever a readable lock file existed, so a stale lock left behind by a
crashed worker (dead pid) shadowed the live workspace-home lock taken by
the currently running fleet worker — the dashboard kept reporting
'worker stopped' while a worker was actually running.

Both lock locations are now always read; a live lock wins regardless of
location, and 'stopped' is only reported when every readable lock
belongs to a dead process.
@danii1
danii1 merged commit 820a0c8 into main Sep 1, 2026
1 check passed
@danii1
danii1 deleted the feature/dev-108 branch September 1, 2026 02:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devintern-authored Pull request written by DevIntern working its own backlog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant