Store empty RepoConfig when config.toml is absent#121
Draft
xmtp-coder-agent wants to merge 1 commit intoxmtplabs:mainfrom
Draft
Store empty RepoConfig when config.toml is absent#121xmtp-coder-agent wants to merge 1 commit intoxmtplabs:mainfrom
xmtp-coder-agent wants to merge 1 commit intoxmtplabs:mainfrom
Conversation
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
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.
Resolves #120
Summary
When a push to the default branch arrives for a repo that does not have
.code-factory/config.toml,runSyncRepoConfigwas skipping theRepoConfigDOwrite entirely. Downstream,getRepoConfig()then returnednull, andrunCreateTaskfell back to the legacy URL-as-prompt template path — so repos without a config file never reached the newcode-factorytemplate.This change writes an empty settings record (
settings: {}) to the DO when the file is absent.resolveRepoConfigSettings({})applies all defaults, sogetRepoConfig()now returns a fully-populatedRepoConfig(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— whenfetch-config-filereportspresent: false, skipparse-and-validateand fall through tostore-repo-configwithsettings: {}.src/workflows/steps/sync-repo-config.test.ts— update the "file absent" unit test to assert thatsetRepoConfigis called with empty settings and thatparse-and-validateis not called.src/workflows/repo-config-workflow.test.ts— mockstore-repo-configin the file-absent dispatch test.Unchanged behavior
NonRetryableErrorfromparse-and-validate.routePush.RepoConfigDO, schema module, and template-selection logic are unchanged.Test plan
npm test— 374 passednpm run typechecknpm run lintnpm run format:checkNote
Store empty RepoConfig settings when
config.tomlis absentPreviously,
runSyncRepoConfigreturned 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 viasetRepoConfig, skipping only the parse-and-validate step.Behavioral Change: repos with no
config.tomlwill now have an empty settings record written to the DO on each sync, where previously no write occurred.Macroscope summarized 76fbf32.