Remove hardcoded TASK GUIDANCE; default 'code' task type owns it instead#559
Open
kylecarbonneau wants to merge 1 commit into
Open
Remove hardcoded TASK GUIDANCE; default 'code' task type owns it instead#559kylecarbonneau wants to merge 1 commit into
kylecarbonneau wants to merge 1 commit into
Conversation
kylecarbonneau
added a commit
to kylecarbonneau/taskyou
that referenced
this pull request
Jun 6, 2026
…ves the injection)
The executors injected a hardcoded TASK GUIDANCE block into every task launch (Claude via --append-system-prompt, Gemini via GEMINI.md, and appended to the prompt for pi/codex/openclaw). The content was opinionated, Claude-specific, and not user-controllable. This completes the direction Bruno already started in cb7a3e1 ("Add PR submission reminder to coding task system prompt", branch task/142-coding-tasks-system-prompt), which placed coding guidance in the default 'code' task type's instructions rather than the executor. This change folds the remaining executor-injected guidance into that same task type so default-config users get identical behaviour while gaining full control via the existing task-type editing UI. - Delete buildSystemInstructions() and all its callsites across the claude/pi/gemini/codex/openclaw executors; drop the now-dead systemFile creation and the --append-system-prompt flag (each Sprintf verb/arg count rebalanced; go vet printf analyzer stays clean). - Move the guidance into the default 'code' task type instructions in internal/db/sqlite.go. - Add a content-match-guarded, idempotent migration that upgrades an existing 'code' row only when it still holds the byte-exact old default, so customized rows are never clobbered. - Update tests: drop the executor-side assertion on the deleted function; add db tests covering the seeded guidance and the migration. Note: type instructions are delivered via the initial user prompt rather than --append-system-prompt. For the default 'code' type the net effect on agent behaviour is indistinguishable (same text reaches the agent). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
99b8775 to
5965840
Compare
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.
Remove hardcoded TASK GUIDANCE; default 'code' task type owns it instead
What
Removes the hardcoded
buildSystemInstructions()"TASK GUIDANCE" block from theexecutors and folds its content into the default
codetask type'sinstructionsinstead.Concretely:
Deletes
buildSystemInstructions()and every callsite that consumed it. Thatblock was injected into each task launch through several channels:
claude_executor.go+ the interactive launch paths inexecutor.go):a
--append-system-prompt "$(cat <tmpfile>)"flag.gemini_executor.go): written to.gemini/GEMINI.mdviawriteGeminiInstructions()(also removed).All of these are now gone, along with the dead temp-file creation and the
per-launch flag. Each
fmt.Sprintfthat built a launch command was rebalanced soits verb count matches its argument count (the
go vetprintf analyzer staysclean).
Moves the guidance into the default
codetask type's seededinstructionsin
internal/db/sqlite.go, matching the plain-text style already used by thewritingandthinkingdefaults (and the existingcodedefault). The contentpreserved: the
taskyou_get_project_contextMCP caching nudge, the worktreeworking-directory constraint, the
taskyou_screenshothint for frontend work, andthe GitHub-CLI / shared-GraphQL-bucket etiquette.
Adds a content-match-guarded migration for existing installs
(
migrateCodeTaskTypeGuidance): it runsUPDATE task_types SET instructions = <new> WHERE name = 'code' AND instructions = <old>,where
<old>is the byte-exact previous default. It only upgrades a row that stillholds the old default, so any user-customized
coderow is left untouched. It isidempotent — on the new schema the
WHEREclause matches nothing.Why
The TASK GUIDANCE block was opinionated, Claude-specific
(
taskyou_get_project_context, worktree warnings,ghrate-limit etiquette), andnot user-controllable — there was no way to customize or opt out of it. It read
as a vestige of a single-team / single-workflow setup.
This change completes a direction already established in the codebase. In
commit
cb7a3e1f("Add PR submission reminder to coding task system prompt", branchtask/142-coding-tasks-system-prompt, merged via #65), the PR-submission reminderfor coding tasks was added to the
codetask type's instructions — theuser-prompt path — rather than to the executor's hardcoded block. That set the
precedent that coding guidance belongs in the task type, where users can see and
edit it. This PR follows that same path for the remaining executor-injected
guidance, consolidating all of it into the one place Bruno already chose.
Result:
existing task-type editing UI — exactly how the
writingandthinkingtypes areconfigured today.
cased per executor backend.
Note on delivery channel
The task-type
instructionsare delivered via the initial user prompt, whereasthe removed block was delivered via
--append-system-prompt(Claude) /GEMINI.md(Gemini). This is a slight delivery shift. For the defaultcodetypethe net effect on agent behaviour is indistinguishable — the agent receives the
same text either way. For users who care about the distinction, they now have full
control over the content through the task type, on whichever delivery channel the
backend uses for instructions.
How tested
go build ./...— clean.go vet ./...— clean (the printf analyzer confirms every rebalanced launchSprintfhas matching verb/arg counts).go test ./...— all packages pass.internal/dbtests:TestDefaultCodeTaskTypeGuidance— a freshly migrated DB seeds thecodetasktype with the GitHub-CLI etiquette and the
taskyou_get_project_contextnudge.TestMigrateCodeTaskTypeGuidance— a row holding the old default is upgraded;a customized row is left untouched (non-clobbering / idempotent).
TestBuildSystemInstructions_GitHubGuidance(the function itasserted no longer exists); its intent is now covered by the db tests above.
Follow-up (separate PR)
A natural next step is to let users drop the default task-type guidance entirely
(remove the seeded
instructionscontent forcode/writing/thinking). That isa larger behavioural change deserving its own migration and deprecation path, so it
is intentionally not bundled here.