Skip to content

fix(skills): notebook JSON escaping + report overwrite guidance (terra telemetry)#241

Closed
gewenyu99 wants to merge 1 commit into
experiment/orchestratorfrom
posthog-code/notebook-escaping-fix
Closed

fix(skills): notebook JSON escaping + report overwrite guidance (terra telemetry)#241
gewenyu99 wants to merge 1 commit into
experiment/orchestratorfrom
posthog-code/notebook-escaping-fix

Conversation

@gewenyu99

Copy link
Copy Markdown
Collaborator

What

Two prompt fixes in the integration-v2 report step, driven by wizard remark telemetry from the gpt-5.6-terra rollout (2026-07-15, ~10 remarks in the first hour of external traffic):

  1. skills/integration-v2/notebook — agents repeatedly failed notebooks-create calls by pasting raw multi-line report markdown into the JSON payload ("repeated notebooks-create JSON parsing failures"). The skill now:

    • says to Read the finished posthog-setup-report.md first (and not before the report step wrote it)
    • names the exact tool (notebooks-create via posthog_exec) so no tool-search round-trip is needed — one run wasted a lookup on a scope-gated alias surfaced first
    • spells out the escaping contract: \n / \" / \\, one single-line string, and fix-the-escaping-don't-trim-the-report on rejection
  2. skills/integration-v2/report — remarks disagreed about read-before-write because the correct behavior differs: fresh runs must write directly (a read errors on the missing file), re-runs must Read first (harnesses refuse to overwrite an unread file). The skill now states both cases.

Why now

All terra runs still succeeded — these loops cost retries, tokens, and ~seconds of wall-clock per run, not outcomes. But they're the top remark cluster by far (notebook escaping alone is 10+ mentions) and the fix is decoupled from the wizard release cycle.

Notes

  • npm test passes (121/121). npm run build is broken on the experiment/orchestrator tip before this change: agents/integration-v2/build.md (and possibly siblings) still declare flow: "posthog-integration" after the rename in 23276d8. Not addressed here to avoid colliding with in-flight rename work — flagging for whoever owns it.

Created with PostHog Code

…telemetry

Wizard remark telemetry from the gpt-5.6-terra rollout (2026-07-15) shows two
recurring frictions in the report/notebook step, ~10 mentions in the first
hour, all recovered but each burning retries:

- notebooks-create payloads failing to parse because the report markdown was
  pasted into the JSON literal unescaped. The notebook skill now spells out
  the escaping contract (newlines, quotes, backslashes → one single-line
  string), says to Read the finished report first, names the exact tool so no
  tool search is needed, and forbids trimming the report to dodge a parse
  failure.
- the report task erroring on re-runs because harnesses refuse to overwrite a
  file that wasn't read. The report skill now distinguishes the fresh-write
  case from the replace-a-leftover case.

Generated-By: PostHog Code
Task-Id: 843d9848-d7ad-4bab-96d2-a78e0411251f
@gewenyu99
gewenyu99 requested a review from a team as a code owner July 15, 2026 22:42
@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 basic-integration
  • /wizard-ci mcp-analytics
  • /wizard-ci revenue

Test an individual app:

  • /wizard-ci basic-integration/android
  • /wizard-ci basic-integration/angular
  • /wizard-ci basic-integration/astro
Show more apps
  • /wizard-ci basic-integration/django
  • /wizard-ci basic-integration/fastapi
  • /wizard-ci basic-integration/flask
  • /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 mcp-analytics/custom-dispatcher
  • /wizard-ci mcp-analytics/typescript-sdk
  • /wizard-ci revenue/stripe

Results will be posted here when complete.

@gewenyu99

Copy link
Copy Markdown
Collaborator Author

Superseded: notebook JSON-escaping reshaped as the integration-v2 notebook microskill, and dashboard split into dashboard+insight microskills (experiment/orchestrator). Closing this prompt-patch shape.

@gewenyu99 gewenyu99 closed this Jul 15, 2026
gewenyu99 added a commit that referenced this pull request Jul 15, 2026
Read-then-replace when posthog-setup-report.md already exists (harnesses refuse
to overwrite an unread file) — the salvaged half of the closed #241.

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