Skip to content

fix: config inheritance precedence (project > global > default)#193

Open
bmdavis419 wants to merge 1 commit intocodex/pr-a-git-resource-reliabilityfrom
codex/pr-d-config-inheritance-fix
Open

fix: config inheritance precedence (project > global > default)#193
bmdavis419 wants to merge 1 commit intocodex/pr-a-git-resource-reliabilityfrom
codex/pr-d-config-inheritance-fix

Conversation

@bmdavis419
Copy link
Collaborator

@bmdavis419 bmdavis419 commented Feb 28, 2026

Summary

  • resolve effective model/provider/settings using project override -> global -> default
  • add regression coverage for inheritance behavior

Issues

Greptile Summary

Fixes config inheritance by implementing proper field-level fallback (project > global > default). Previously, if a project config existed, all fields came from it even when undefined - now each field properly inherits from global config when not specified in project config.

  • Replaced getActiveConfig() with individual getter functions for model, provider, providerTimeoutMs, and maxSteps
  • Each field now uses proper nullish coalescing: currentProjectConfig?.field ?? currentGlobalConfig.field ?? DEFAULT
  • Improved path handling by replacing string concatenation with path.join() and path.dirname() for cross-platform compatibility
  • Added regression test verifying that project configs without provider/model inherit from global config

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • Clean implementation of the intended behavior with comprehensive test coverage. No breaking changes detected - the new behavior is more correct than the old. Path handling improvements are safe refactors. All existing tests should continue passing.
  • No files require special attention

Important Files Changed

Filename Overview
apps/server/src/config/index.ts Implements proper config field inheritance (project > global > default) and improves path handling with path.join/dirname
apps/server/src/config/config.test.ts Adds comprehensive test coverage for config inheritance when project config omits provider/model/settings

Last reviewed commit: 43bc6bc

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.

1 participant