Keep dev green after moving the active worktree snapshot

The transferred dev snapshot was not publication-ready yet: full tests still
failed because worktree-local docs resolution assumed a repo-root node_modules
tree, some protocol expectations no longer matched the refactored request
bridges, oauth/account-token route tests reused stale modules after resetting
DATA_DIR, and model discovery still fired unawaited default-token writes.

This follow-up makes the moved dev branch self-consistent and green again by
stabilizing module/test isolation, awaiting token mirroring writes, and
aligning narrow tests with the current transformer and request-builder
contracts.

Constraint: The fix set had to stay narrow and unblock the new dev branch without reworking the broader transferred refactor
Rejected: Revert the transferred snapshot | would lose the user's requested dev-branch continuation point
Confidence: medium
Scope-risk: moderate
Reversibility: clean
Directive: If more DATA_DIR-scoped API test files start flaking under shared workers, reset modules before importing singleton db/config modules instead of relying on process env mutation alone
Tested: git diff --check; npm run typecheck; npm run repo:drift-check; npm test
Not-tested: Live OAuth/provider flows outside the mocked test harness
This commit is contained in:
cita-777
2026-04-17 19:59:14 +08:00
parent 88f40e91f7
commit f67ade2e59
8 changed files with 44 additions and 17 deletions
@@ -154,6 +154,9 @@ describe('shared normalized helpers', () => {
id: 'resp_terminal_2',
model: 'gpt-test',
created: 456,
incomplete_details: {
reason: 'max_output_tokens',
},
output: [
{
type: 'message',