feat(desktop): always-on skills injected into every new task - #76742
Draft
adboio wants to merge 4 commits into
Draft
feat(desktop): always-on skills injected into every new task#76742adboio wants to merge 4 commits into
adboio wants to merge 4 commits into
Conversation
Per-skill "Always-on" toggle (user/marketplace/codex/bundled sources) that
injects toggled skills into every new task's first message — like a channel's
CONTEXT.md — on both cloud and local runs.
Cloud rides the existing bundle-upload pipeline: refs append to the
transport's skillBundles and a /name manifest folds into the first message so
the sandbox's existing inliner picks them up. Local inlines SKILL.md bodies
into initialPrompt via the existing skills.readFile surface. Refs persist as
{name, source} in the settings store and re-resolve at creation, so moved or
deleted skills self-heal. The transcript collapses the injected block into an
"Always-on skills (n)" chip.
Generated-By: PostHog Code
Task-Id: 4e1d8b15-54b7-4555-a21f-150eead107f4
Shows the skills that will be auto-injected into the next task as chips in the new-task page's "Using:" row (beside the channel CONTEXT.md chip) and in the channel feed composer's floating row next to the local/cloud selector. Clicking a chip opens the skill in Settings; the X turns its always-on toggle off globally. Chips render from the same resolution the saga uses at creation, so stale refs never show. Generated-By: PostHog Code Task-Id: 4e1d8b15-54b7-4555-a21f-150eead107f4
The chip X in the composer "Using:" row skips that always-on skill for the task being composed only: the exclusion rides TaskCreationInput.excludedAlwaysOnSkills through the creation saga and is subtracted when the host resolves the always-on set. Global toggles are untouched; clicking the chip body opens Settings -> Skills for the permanent off. Recreates in-flight work from the source-repo session that never reached PostHog/code#4059. Generated-By: PostHog Code Task-Id: 4e1d8b15-54b7-4555-a21f-150eead107f4
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
2 tasks
Contributor
|
Hey @adboio! 👋 It looks like your git author email on this PR isn't your
You can fix it for this repo with: git config user.email "you@posthog.com"Or set it globally with |
Biome useExhaustiveDependencies caught that handleSubmit closed over a stale exclusion list: excluding a skill via the chip X and submitting without a re-render would have ignored the exclusion. Generated-By: PostHog Code Task-Id: 4e1d8b15-54b7-4555-a21f-150eead107f4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Ports PostHog/code#4059 into
products/desktop/. The source repo is frozen after the desktop import, so the PR is remade here to land, perproducts/desktop/MIGRATION.md.Original problem statement:
Skills only activate today when a task's prompt explicitly references them (
/nameor a composer skill chip). There's no way to say "apply this skill to everything I do" — the way a channel's CONTEXT.md is injected automatically, or the way a SessionStart-hook plugin (e.g. i-have-adhd) puts its instructions in context from turn one.Refs PostHog/code#3735 (earlier attempt, auto-closed as stale; this supersedes it).
Changes
user/marketplace/codex/bundledsources. Repo-source skills are excluded so behavior is identical for repo and repo-less tasks. Toggles persist in the settings store as{name, source}refs and re-resolve against the live skill list at task creation, so moved/deleted skills self-heal.skillBundles(uploaded with the first message, warm and cold paths) and a<always_on_skills>manifest of/namementions is folded into the first message, which the sandbox's existing inliner expands into each bundle's full SKILL.md. Zero sandbox/server changes.skills.readFiletRPC), with per-skill/total size caps degrading to path references.TaskCreationInput.excludedAlwaysOnSkillsthrough the creation saga, so the preview and the injected set stay in lockstep. Clicking the chip body opens Settings, Skills to toggle it off globally.How did you test this code?
git am -3 --directory=products/desktop/, then re-applied the in-flight per-task exclusion change as a third commit. Two conflicts against newer commits in the imported tree were resolved socollapsePiSkillInvocation(fix(ui): collapse Pi skill invocations code#4056) composes with the always-on strip inUserMessage.tsxandChatThread.tsx.products/desktop/:pnpm install --frozen-lockfile,pnpm typecheck(24/24 packages green), and full unit suites on the touched packages:@posthog/core2994,@posthog/ui2511,@posthog/shared780, all passing.Automatic notifications
Docs update
No desktop docs cover skills settings yet; nothing to update.
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
git am --directory=products/desktop/preserved the original commits and their authorship.Created with PostHog Code