Switch to code-factory template + structured template inputs#115
Merged
Switch to code-factory template + structured template inputs#115
Conversation
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ure Zed LSP Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ard preconditions Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ll EARS-17 test Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…al-storage Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Declares var.docker_enabled (default false) in the workspace-pod module, wraps the DOCKER_HOST env and dind container in dynamic blocks gated on that variable, and moves the kubernetes_pod_v1/kubernetes_deployment_v1 resources to root scope so terraform test assertions can reference them directly. Threads docker_enabled = local.docker through the module call so the TaskMetadata docker field controls sidecar presence end-to-end. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ker_enabled" This reverts commit 6870e616c17a5197ecd9aa5e0f845aa8ae14039f.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…mapping Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
task-action | 045a242 | Apr 21 2026, 06:43 AM |
ApprovabilityVerdict: Needs human review This PR introduces significant new runtime behavior: conditional template selection based on repo config, new JSON structured inputs for task creation, volume size normalization, and provider enum changes. While well-tested, the changes affect production task creation workflows and warrant human review. You can customize Macroscope's approvability policy. Learn more. |
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.

Summary
Adds the wiring needed to route
task_requestedworkflows through the newcode-factoryCoder template when a repo has a.code-factory/config.toml, while keeping the legacy template behavior untouched for repos without one.What changed
Workflow:
runCreateTasklookup-repo-configstep (betweenlookup-coder-userandcreate-coder-task) that reads the per-repoRepoConfigDO.null, the flow is unchanged: prompt = issue URL, legacy template.TemplateInputspayload and passestemplateName: config.codeFactoryTemplateintocoder.create(...).RunCreateTaskContextgains anenv: { REPO_CONFIG_DO }seam;TaskRunnerWorkflowthreadsthis.env.REPO_CONFIG_DOthrough to the step factory.New
TemplateInputsschema (src/workflows/steps/template-inputs.ts)repo_url,base_branch?,repo_name,ai_prompt,ai_provider,extra_volumes?,size,docker).buildTemplateInputs()composes the payload from(repository, issue, settings).ai_promptis pre-filled for the/coder-taskskill:Event shape
TaskRequestedEvent.issuegainsid: number. The router now populates it frompayload.issue.id.AppConfigcodeFactoryTemplate: z.string().min(1).default("code-factory"). Intentionally not wired to an env var inloadConfig— the template name is hardcoded and used only on the new-config branch.RepoConfigSchemaHarnessProviderSchemaenum updated:"claude"→"claude_code"(and the resolved default). Matches the Terraform template'sai_providervalues.VolumeSizeSchemathat accepts common variants (10gb,10GB,10G,10gi,500mb,2tb,64k, with optional whitespace) and transforms to the canonical Kubernetes binary-SI form (10Gi). Wired into both the stored (write-path) and resolved (read-path) schemas, so:buildTemplateInputsconsumer receives already-canonical sizes."10gb"→"10Gi".CoderService.createtemplateName?: string(mirrored on theTaskRunnerinterface). When provided, overrides the runner-configured template at the endpoint-resolution step. All other semantics unchanged.Test coverage
create-task.test.ts: step-order assertion updated to includelookup-repo-config; new cases cover both branches — null config (legacy prompt, no templateName override) and present config (JSONTemplateInputswithcodeFactoryTemplate, asserting the fullai_promptblock).repo-config-schema.test.ts:test.eachover 13 size-input variants → canonical form, re-normalization of legacy stored values on read, andtest.eachover invalid formats → rejection. Existing fixtures updated (claude→claude_code,20gb→20Gi,10gb→10Gi).repo-config-do.test.ts,router.test.ts,task-runner-workflow.test.ts,instance-id.test.ts: fixture shapes updated for the newissue.idfield and canonical volume sizes.All 373 tests pass; typecheck + biome lint/format clean.
Test plan
npx tsc --noEmitpassesnpm test— 373 passing (pre-existing terraform-submodule suites still skipped due tobun:testimports — unrelated)issues.assignedagainst a repo with and without.code-factory/config.toml, verifyTaskRunnerWorkflowinstance logs show the newlookup-repo-configstep and correct template selection.Note
Switch task creation to use code-factory template with structured inputs when repo config exists
runCreateTasknow performs alookup-repo-configstep viaRepoConfigDO; if a config is found, it builds structuredTemplateInputsJSON (includingai_provider, volumes, andISSUE_ID) and targets thecode-factorytemplate instead of passing a plain issue URL.buildTemplateInputsandbuildAiPrompthelpers in template-inputs.ts to construct the structured payload from repository, issue, and repo config settings.10gb→10Gi) via a newVolumeSizeSchemaandnormalizeVolumeSizeutil in repo-config-schema.ts; invalid formats are now rejected on parse.claudetoclaude_codeinHarnessProviderSchemaand updates the default accordingly.TaskRequestedEventnow includesissue.id, andCoderService.createaccepts an optionaltemplateNameoverride.Macroscope summarized 045a242.