Skip to content

feat(handoff): publish_handoff mirrors the report into a PostHog notebook - #1437

Merged
gewenyu99 merged 2 commits into
mainfrom
vincent/handoff-notebook
Oct 12, 2026
Merged

gewenyu99 merged 2 commits into
mainfrom
vincent/handoff-notebook

Conversation

@gewenyu99

@gewenyu99 gewenyu99 commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

The report task mirrors the report into a notebook through the MCP's notebooks-create-markdown, which exists only when revamped-py-notebooks is on (about 20% of orgs), so the step fails and turns otherwise finished runs into errors (48 of 77 runs with a failed report in 7 days).

Changes

  • publish_handoff creates the notebook through the notebooks API with the run's login, one per program per run (a retry updates it), and emits the link to the outro.
  • Only programs whose prompts mirror the report get a notebook: posthog-integration (v1 and v2), metrics, and wizard skill integration-*. It is a per-program setting, not a tool argument.
  • The sync is best effort and bounded: one 8 s deadline, one retry on a network error or 5xx, and a lost create response is recovered by looking the notebook up by short_id. A skip says why in the result (Notebook not created: … or Notebook not updated: … earlier report: <url>); the tool never fails for it.
  • The rotate-on-401-and-retry logic is one shared helper in @shared/oauth-session, used here and by the task-stream sync and the GitHub check, with each site's behavior unchanged.
  • handoff published records notebook_requested, notebook_outcome and notebook_skip_reason.

Test plan

Check Result
vitest run (full) 3661 passed; mcp-screen-outcome flakes at base too, passes alone
pnpm typecheck, eslint, prettier clean (0 errors)
Local stack, posthog-integration, flag off (before the review fixes) 7/7 steps; one notebook made by publish_handoff; link in outro; 0 MCP notebook calls

Release order

Release PostHog/context-mill#423 first. It is safe alone, because older wizards get no notebook note from publish_handoff and take the MCP fallback. #1437 must not reach users before #423 is served, or orgs with the flag on get two notebooks per run.

Sources

🤖 Generated with Claude Code

…book

The wizard creates the notebook through the notebooks API with the run's
login, so it no longer depends on the flag-gated MCP notebook tools. On by
default; create_notebook: false opts out. A notebook failure never fails
the tool.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@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.

- Notebook mirroring is a per-program setting (integration v1/v2, metrics,
  integration agent-skills) instead of a model-facing create_notebook arg.
- One 8 s deadline over the whole sync, one retry on network errors and 5xx.
- A lost create response is recovered by looking the notebook up by short_id.
- A failed update says the notebook was not updated and links the earlier one.
- The rotate-on-401 retry is one shared helper used at all three call sites.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gewenyu99
gewenyu99 marked this pull request as ready for review October 12, 2026 18:01
@gewenyu99
gewenyu99 requested review from a team as code owners October 12, 2026 18:01
@gewenyu99
gewenyu99 merged commit 29c401f into main Oct 12, 2026
19 checks passed
@gewenyu99
gewenyu99 deleted the vincent/handoff-notebook branch October 12, 2026 18:18
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