Repository navigation
fix: initialize workspace before its first model selection - #175
Open
rudycelekli wants to merge 1 commit into
Open
rudycelekli wants to merge 1 commit into
rudycelekli wants to merge 1 commit into
Conversation
Signed-off-by: Rudy Celekli <rudy@gradiahq.com>
This branch has not been deployed
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
Initialize the workspace before saving its first selected model.
The workspace manager can read its default model before chat or vault has created a database workspace. Its public
settings.selectModelmutation then inserts a setting referencing that absent workspace and fails the workspace foreign key. Call the existing idempotentensureScopeservice before that write, creating the workspace and membership through the same supported initialization used by other services.Reproduction and controls
The regression runs the actual tRPC application caller and settings service with real PGlite, Drizzle and committed migrations. Only the database driver getter is replaced. Reading a fresh workspace returns the supported default model without creating a row; selecting that default through the public mutation then fails on unchanged source. The initialized-workspace control succeeds.
Before: 1 failure / 1 passing control. After: 4/4 tests pass including the two existing router controls. Tests also check persistence, membership initialization and later model changes without duplicate rows. No HTTP authentication, provider availability, live model execution or deployed PostgreSQL claim.
Required local gates with Node 24.18.0 and declared pnpm 11.24.0:
pnpm check: 6/6 tasks pass, including lint and generated-route types. The test task covers 96 files / 878 tests. The final run reused three successful task results from the preceding exact-source check; lint/types ran successfully after the actualnext typegencommand. The earlier serial check failed on generated Next route globals before type generation; that failure is retained with the successful rerun.pnpm build: passes using owned public database/Kernel/auth URL placeholders. No deployment or live service claim.The unchanged declared Checks workflow completed successfully on exact signed head
2c5a9818f2f2e29086ba9e5d724684dc4480871e: frozen dependency installation, fullpnpm check(96 files / 878 tests, all six check tasks), and completepnpm test:runtime(two isolated mock-model workflow evals / 13 gates, including cleanup). Hosted Node 24.21.0 follows the declared Node 24 version; pnpm is 11.24.0. The PR merge checkout tree matches the reviewed source head. No workflow, dependency or runtime fixture changes were made.Scope and overlap
Two source insertions plus colocated caller regression tests. No schema, migration, dependency, authentication, UI or workflow changes. Pending PR #146 changes the same settings file to add an optional direct Gemini provider and rename model helpers. Its current patch still does not initialize the workspace before the write; its provider feature does not fix this independently reproduced first-use failure. The other 13 current open PRs have no direct path overlap. Existing current issues and recent closed/merged PR records were screened for this cause.
AI assistance was used for investigation, implementation, tests and review under the submitting account. Signed DCO commit included.