Skip to content

fix(server): thread split suggestions catch more new tasks - #66

Draft
ScriptedAlchemy wants to merge 4 commits into
mainfrom
fix/thread-split-contextual-prompt
Draft

ScriptedAlchemy wants to merge 4 commits into
mainfrom
fix/thread-split-contextual-prompt

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

Thread split suggestions almost never fire usefully. On a held-out test of Claude and Codex threads, the prompt and threshold shipped in #55 caught 1 of 33 real new tasks.

This PR switches the shared prompt to the contextual prompt, lowers the threshold from 0.94 to 0.6538, and skips the model request for drafts under five words. The feature stays passive and opt-in, and the eval keeps the old prompt as baseline for comparison.

421 held-out Claude and Codex messages AUC Real new tasks caught False suggestions Precision among known labels
main: baseline, 0.94 0.749 1/33 3/375 25.0% (1/4)
This PR: contextual, 0.6538, five words 0.886 8/33 6/375 57.1% (8/14)

The table calculates precision from the reported true and false suggestions and excludes uncertain labels, as the evaluator does. The earlier 12.5% and 44.4% figures used a different denominator, and reconciling them needs the private score receipts. These corrections are arithmetic and do not come from a new model evaluation.

Both offline runners now support --min-message-words 5 to reproduce the shipped five-word minimum. The experiment records that choice in its scoring receipts and frozen calibration selection, and it keeps the original baseline's eligibility.

  • Recall rose by 8.6 to 36.7 points, on a 95% interval that resamples whole threads.
  • False suggestions are at 1.6%, above the 1% calibration target. The increase over main is within noise, at -0.5 to +2.3 points.
  • An earlier test on 927 mostly Cursor messages used the same prompt and threshold without the word minimum. It had 20.0% weighted recall and 1.09% false suggestions.

The experiment froze the threshold on calibration data and chose the word minimum before it read the test split.

Limits

  • The data is one user's history. The test excludes threads with credential-shaped text, which skews the sample toward shorter threads.
  • The prompt misses most new tasks, so it suits a hint and not automatic splitting.
  • These numbers come from direct model scoring. Only the updated unit test covers the service's HTTP path, and no live replay covers it.

Verification

  • Scoped formatting, lint, both Knip passes, GraphQL validation, the native addon build, and selected tests pass.
  • The new short-message test row fails against main's service code.
  • python3 -m unittest discover -s evals/thread-split passes (7 tests), including short-draft and receipt-policy regressions.
  • The scoped TypeScript tests pass (4 tests), and direct server typechecking passes. The local aggregate typecheck wrapper cannot initialize its seccomp supervisor in this environment.

Still in progress

This PR stays a draft while a local improvement run finishes. It may gain a shorter history or a retrained final layer if either beats this configuration on a fresh sealed test. The run has these results so far:

  • Combining small models gave no gain beyond noise.
  • Separate thresholds by thread length did slightly worse.
  • The last 3 turns instead of the full history gave a small recall gain on Claude and Codex, stayed within noise overall, and ran 3x faster.
  • The retrained final layer is still running. mlx-decision 1.1.0 drops a saved pplx yes/no fit on load, so any trained model needs a fix or a workaround for that before it can ship.

GPT-6 Astra Pro in ChatGPT did the follow-up review and fixes.

Claude Opus 5.5 in T3 Code, through Claude Code.

🤖 Generated with Claude Code

@changeset-bot

changeset-bot Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: a15be6d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ScriptedAlchemy
ScriptedAlchemy force-pushed the fix/thread-split-contextual-prompt branch from 9fe22cb to b51f356 Compare November 5, 2026 05:02
The shipped prompt and 0.94 threshold caught 1 of 33 new tasks on a held-out
Claude and Codex test. Use the contextual prompt at 0.6538, and skip drafts
under five words, which caught 8 of 33.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ScriptedAlchemy
ScriptedAlchemy force-pushed the fix/thread-split-contextual-prompt branch from b51f356 to 8f1a82d Compare November 5, 2026 05:41
@ScriptedAlchemy
ScriptedAlchemy marked this pull request as draft November 5, 2026 07:15
Ignore rolled-back runs and cancelled runs that never started when reconstructing the prior conversation for split suggestions. Match the associated user message as well as runId because canonical user messages can have a null runId. Keep cancelled turns that did start visible.

This prevents abandoned turns from suppressing suggestions or introducing discarded context into model requests. Add regression coverage for all three run states and the exact history sent to the decision model.

Also merge current main and preserve the Android test platform variable. Focused tests, the selected check:changed tests, direct server typechecking, formatting, lint, both knip scans, and GraphQL validation pass. The aggregate typecheck launcher is blocked by the environment's seccomp supervisor.

This branch has not been deployed

No deployments
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