feat(context): wire workspace context pack into execution (§0.1)#8
Merged
Conversation
Inject the Workspace context pack (file tree + conventions) into the task prompt so an agent gets repo context instead of cold-scanning. Opt-in via WORKSPACE_ENABLED; when off (default), no workspace is constructed and the prompt is used verbatim — byte-identical to before. - context/augment.ts: augmentTaskPrompt(task, pack) — compact <workspace-context> header; returns the task unchanged for an empty pack. - context/index.ts: createWorkspace(config) → InProcessWorkspace when enabled, else undefined. - AgentTaskExecutor: optional workspace; execute augments the task when present (classification still uses the original prompt). - MCP coding_agent_run: async handler augments via the workspace before startJob; McpTaskManager stays synchronous. - server.ts / mcp/server.ts build the workspace from config and inject it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Finishes the Workspace wiring follow-up — the context pack now reaches the agent.
What
context/augment.ts—augmentTaskPrompt(task, pack): compact<workspace-context>header (conventions, symbols, file list w/ truncation); returns the task unchanged for an empty pack.context/index.ts—createWorkspace(config)→InProcessWorkspacewhenWORKSPACE_ENABLED, elseundefined.AgentTaskExecutor— optional workspace;executeaugments the task when present (routing still classifies the original prompt).coding_agent_run— async handler augments via the workspace beforestartJob(keepsMcpTaskManagersynchronous, zero task-manager churn).server.ts/mcp/server.tsbuild the workspace from config and inject it.Byte-identical when off
WORKSPACE_ENABLED=false(default) ⇒createWorkspacereturnsundefined⇒ no context call, prompt verbatim. The full pre-existing suite passes unchanged.Gates
typecheck✅ ·lint✅ ·test:coverage✅ (394 tests, 100%) ·build✅.🤖 Generated with Claude Code