refactor(server): optimize injected agent instructions#2977
Draft
reachjalil wants to merge 3 commits into
Draft
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Contributor
|
@reachjalil is attempting to deploy a commit to the Different AI Team on Vercel. A member of the Team first needs to authorize it. |
Collaborator
Author
Experiment status — do not merge yetThis PR is intentionally an experiment. It is not intended to be merged, marked ready, or used as a standalone final prompt decision yet. Keep it in draft while we evaluate the three related changes together and collect model-behavior evidence. Combined experiment branch: The branch is based on current
Combined validation checklistComposition and environment
Automated contracts
Agent search behavior
Contract and safety preservation
Prompt-layer behavior
Decision gate
|
25 tasks
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.
Intent
Reduce always-on desktop-agent instructions to the OpenWork-specific decisions the model cannot safely infer: workspace output paths, private-data boundaries, confirmed Memory Bank writes, product-doc routing, live Connect state, and boundaries between UI, browser, session, extension, and Cloud tools.
The goal is not brevity by itself. It is less duplicated context, fewer conflicting instructions, and fewer unnecessary tool calls while preserving product and safety invariants.
Methodology
experimental.chat.system.transformplugins.This follows current guidance to use lean prompts, avoid repeated instructions/examples, keep tool descriptions concise, prioritize critical constraints, and validate changes on representative behavior:
Reassessment
2-4searches, service lists, repeated settings examples, equivalent retriesMeasured change
e967b255d): 18,380 characters across the nine base and conditional instruction variants.This is an instruction-inventory comparison, not a claim that every request previously included every conditional variant.
Checks
pnpm --dir apps/server exec bun test src/opencode-plugins/openwork-system-instructions.test.ts src/opencode-plugins/openwork-capabilities-knowledge.test.ts src/opencode-plugins/openwork-extensions-preview-connect-steering.test.ts src/opencode-plugins/openwork-extensions-preview.test.ts src/openwork-runtime-config.test.ts— 39 passedpnpm --filter openwork-server typecheck— passedgit diff --check— passedThe new instruction-design tests inventory all variants, require scoped headings, reject shouty
ALWAYS/CRITICAL/FIRSTwording, enforce separation between retrievable product detail and live state, and cap the combined inventory at 4,000 characters.Impact and gaps