Skip to content

Store empty RepoConfig when config.toml is absent#121

Draft
xmtp-coder-agent wants to merge 1 commit intoxmtplabs:mainfrom
xmtp-coder-agent:fix/issue-120
Draft

Store empty RepoConfig when config.toml is absent#121
xmtp-coder-agent wants to merge 1 commit intoxmtplabs:mainfrom
xmtp-coder-agent:fix/issue-120

Conversation

@xmtp-coder-agent
Copy link
Copy Markdown
Collaborator

@xmtp-coder-agent xmtp-coder-agent commented Apr 21, 2026

Resolves #120

Summary

When a push to the default branch arrives for a repo that does not have .code-factory/config.toml, runSyncRepoConfig was skipping the RepoConfigDO write entirely. Downstream, getRepoConfig() then returned null, and runCreateTask fell back to the legacy URL-as-prompt template path — so repos without a config file never reached the new code-factory template.

This change writes an empty settings record (settings: {}) to the DO when the file is absent. resolveRepoConfigSettings({}) applies all defaults, so getRepoConfig() now returns a fully-populated RepoConfig (sandbox.size="medium", sandbox.docker=false, sandbox.volumes=[], harness.provider="claude_code", scheduled_jobs=[]), and the task-creation path naturally uses the new template.

Changes

  • src/workflows/steps/sync-repo-config.ts — when fetch-config-file reports present: false, skip parse-and-validate and fall through to store-repo-config with settings: {}.
  • src/workflows/steps/sync-repo-config.test.ts — update the "file absent" unit test to assert that setRepoConfig is called with empty settings and that parse-and-validate is not called.
  • src/workflows/repo-config-workflow.test.ts — mock store-repo-config in the file-absent dispatch test.

Unchanged behavior

  • File-present happy path (fetch → parse → store) is untouched.
  • Invalid TOML / Zod failures on a present file still throw NonRetryableError from parse-and-validate.
  • Non-default-branch pushes are still skipped at routePush.
  • RepoConfigDO, schema module, and template-selection logic are unchanged.

Test plan

  • npm test — 374 passed
  • npm run typecheck
  • npm run lint
  • npm run format:check

Note

Store empty RepoConfig settings when config.toml is absent

Previously, runSyncRepoConfig returned early without writing to the Durable Object when the config file was missing. Now it always writes an envelope with empty settings ({}) to the DO via setRepoConfig, skipping only the parse-and-validate step.

Behavioral Change: repos with no config.toml will now have an empty settings record written to the DO on each sync, where previously no write occurred.

Macroscope summarized 76fbf32.

When a push to the default branch arrives for a repo without
.code-factory/config.toml, runSyncRepoConfig now writes an empty
settings record to RepoConfigDO instead of skipping the DO entirely.
This lets downstream getRepoConfig() return a fully-defaulted RepoConfig
so task creation uses the new code-factory template with defaults,
rather than falling back to the legacy URL-as-prompt path.

Resolves xmtplabs#120
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing config.toml file should not error

1 participant