Skip to content

feat(tui): lead the exit line with the report's needs-attention items - #1352

Merged
gewenyu99 merged 4 commits into
mainfrom
posthog/handoff-needs-attention
Oct 7, 2026
Merged

gewenyu99 merged 4 commits into
mainfrom
posthog/handoff-needs-attention

Conversation

@gewenyu99

Copy link
Copy Markdown
Collaborator

Problem

A run can end with steps the user still owes, like a missing .env loader or CI secrets. They sit deep in the report, and the terminal only shows "✔ … configured!".

Part of #1329. Pairs with PostHog/context-mill#408, which makes the error-tracking report open with the block.

Changes

  • publish_handoff description. Reports open with a > ⚠️ **Needs your attention** block when work is left.
  • readNeedsAttention. Reads that block's bullets (src/shared/utils/needs-attention.ts).
  • Exit line. Prints ⚠ Needs your attention: and the bullets first, Ctrl+C included. Reads the published handoff, else the outro's report file.
  • CONTEXT_MILL_URL. Dev-only, points --local-context-mill at another port.

Test plan

  • Unit tests for the parser and the exit line (published handoff, report file, exit before the outro, no block).
  • Real headless error-tracking --ci run on express-todo with context-mill#408 served locally: the report opened with the block, and the exit line rendered its 5 bullets above ✔ Error tracking configured!.
  • pnpm typecheck, pnpm lint (0 errors), pnpm test (202 files, 3362 tests).

Created with PostHog Desktop

A run can finish with steps the user still owes, and those were buried in
the report. publish_handoff now asks every agent to open its report with
a `> ⚠️ **Needs your attention**` block, and the exit line, Ctrl+C
included, prints those bullets first. It reads them from the published
handoff, or from the outro's report file when nothing was published.

CONTEXT_MILL_URL points --local-context-mill at a port other than 8765.

Part of #1329

Generated-By: PostHog Desktop
Task-Id: d14e92bb-6ee1-49b5-8502-39cb80079589
@github-actions

Copy link
Copy Markdown

🧙 Wizard CI

Run the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands:

Test all apps:

  • /wizard-ci all

Test all apps in a directory:

  • /wizard-ci ai-observability
  • /wizard-ci basic-integration
  • /wizard-ci feature-flags
  • /wizard-ci mcp-analytics
  • /wizard-ci replay-vision
  • /wizard-ci revenue
  • /wizard-ci self-driving
  • /wizard-ci warehouse
  • /wizard-ci warehouse-seeded

Test an individual app:

  • /wizard-ci ai-observability/anthropic
  • /wizard-ci ai-observability/google-adk
  • /wizard-ci ai-observability/groq
Show more apps
  • /wizard-ci ai-observability/manual-capture
  • /wizard-ci ai-observability/openai
  • /wizard-ci ai-observability/openai-agents
  • /wizard-ci ai-observability/opentelemetry
  • /wizard-ci ai-observability/vercel-ai
  • /wizard-ci basic-integration/android
  • /wizard-ci basic-integration/angular
  • /wizard-ci basic-integration/astro
  • /wizard-ci basic-integration/django
  • /wizard-ci basic-integration/fastapi
  • /wizard-ci basic-integration/flask
  • /wizard-ci basic-integration/flutter
  • /wizard-ci basic-integration/javascript-node
  • /wizard-ci basic-integration/javascript-web
  • /wizard-ci basic-integration/laravel
  • /wizard-ci basic-integration/next-js
  • /wizard-ci basic-integration/nuxt
  • /wizard-ci basic-integration/python
  • /wizard-ci basic-integration/rails
  • /wizard-ci basic-integration/react-native
  • /wizard-ci basic-integration/react-router
  • /wizard-ci basic-integration/sveltekit
  • /wizard-ci basic-integration/swift
  • /wizard-ci basic-integration/tanstack-router
  • /wizard-ci basic-integration/tanstack-start
  • /wizard-ci basic-integration/vue
  • /wizard-ci feature-flags/django
  • /wizard-ci feature-flags/next-js
  • /wizard-ci mcp-analytics/custom-dispatcher
  • /wizard-ci mcp-analytics/typescript-sdk
  • /wizard-ci replay-vision/javascript-node
  • /wizard-ci replay-vision/next-js
  • /wizard-ci replay-vision/react-vite
  • /wizard-ci revenue/stripe
  • /wizard-ci self-driving/astro
  • /wizard-ci self-driving/fastapi
  • /wizard-ci self-driving/nuxt
  • /wizard-ci self-driving/react-router
  • /wizard-ci self-driving/sveltekit
  • /wizard-ci warehouse/monorepo-env
  • /wizard-ci warehouse/multi-source-next
  • /wizard-ci warehouse/stripe-node
  • /wizard-ci warehouse/zero-source
  • /wizard-ci warehouse-seeded/next-stripe
  • /wizard-ci warehouse-seeded/next-stripe-declined

Test against a Context Mill branch:

  • /wizard-ci all context-mill:my-branch

Add context-mill:<branch> to any command above to pin the Context Mill branch. It defaults to main.

Results will be posted here when complete.

@gewenyu99

Copy link
Copy Markdown
Collaborator Author

Tested on the local stack

wizard error-tracking on a fresh copy of express-todo, at 240f539, against local PostHog, the local ai-gateway and local context-mill with #408's prompts. Driven in tmux, and Ctrl+C was pressed on the outro.

Exit line after Ctrl+C: the needs-attention bullets print above the success line.

exit after ctrl+c

Report: opens with the > ⚠️ **Needs your attention** block. The .env loader is a follow-up, and package.json has no dotenv or --env-file.

report

Outro before exit

outro

@gewenyu99
gewenyu99 marked this pull request as ready for review September 24, 2026 22:59
@gewenyu99
gewenyu99 requested a review from a team as a code owner September 24, 2026 22:59
Comment thread src/tui/exit-line.ts Resolved
@veria-ai

veria-ai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

PR overview

All previously flagged issues have been addressed. No open security concerns remain on this pull request.

Security review

No open security issues remain on this pull request.

Fixed/addressed: 1 · PR risk: 0/10

@johncwaters johncwaters left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Automated review. Not written by a human.

src/shared/utils/needs-attention.ts:94 (line not in the diff)

Nit: only the first line of each bullet is kept, so a bullet wrapped onto a > continuation line loses its tail. Append non-bullet quoted lines to the previous item.

Comment thread src/tui/exit-line.ts
const items = markdown ? readNeedsAttention(markdown) : [];
if (items.length === 0) return null;
return (
`${YELLOW}${BOLD}⚠ ${NEEDS_ATTENTION_HEADING}:${RESET_ATTRS}\n` +

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Automated review. Not written by a human.

Bullet text comes from agent-written markdown (handoff or report file) and is printed raw to the terminal. Control sequences such as ESC in an item could recolor, move the cursor, or spoof output after exit. Strip C0/C1 control characters from each item before printing (or in readNeedsAttention).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, NotVincent here :disguise-emoji:, I will do the deeds

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's done, NotVincent will tell Vincent to double check.

Comment thread src/tui/exit-line.ts
items.map((item) => ` • ${item}`).join('\n')
);
}

export function getExitLine(store: WizardStore): string {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Automated review. Not written by a human.

Nit: the warning block is also prefixed on run failure, above "The wizard is unavailable". Skip it when isRunFailure is true, or confirm that is intended.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, NotVincent here :disguise-emoji:, I will do the deeds

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's done, NotVincent will tell Vincent to double check.

gewenyu99 and others added 3 commits October 7, 2026 09:59
…p them on run failure

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…next line

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gewenyu99

Copy link
Copy Markdown
Collaborator Author

Nit: only the first line of each bullet is kept, so a bullet wrapped onto a > continuation line loses its tail.

Hi, NotVincent here :disguise-emoji:, I will do the deeds

It's done, NotVincent will tell Vincent to double check.

@gewenyu99
gewenyu99 requested review from a team and johncwaters October 7, 2026 14:05

@johncwaters johncwaters left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Automated review. Not written by a human.

Approved by hand after checking the automated review.

Comment thread src/shared/local-dev.ts
export const CONTEXT_MILL_LOCAL_URL = 'http://localhost:8765';
// `CONTEXT_MILL_URL` points `--local-context-mill` at another port.
export const CONTEXT_MILL_LOCAL_URL =
process.env.CONTEXT_MILL_URL || 'http://localhost:8765';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Automated review. Not written by a human.

Nit: a trailing slash in CONTEXT_MILL_URL yields a double slash in ${CONTEXT_MILL_LOCAL_URL}/skill-menu.json. Trim trailing slashes, e.g. .replace(/\/+$/, '').

@gewenyu99
gewenyu99 merged commit 146c6b8 into main Oct 7, 2026
18 checks passed
@gewenyu99
gewenyu99 deleted the posthog/handoff-needs-attention branch October 7, 2026 14:46
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