fix(workspace): a blank field in `altimate.json` reads as signed out, not as an unreadable link
RA
1h ago+163+163+012345678901234567890123456789-7-7-0123456789
Issue for this PR
Closes #1903
Type of change
- Bug fix
- New feature
- Refactor / code improvement
- Documentation
What does this PR do?
Since #1835 getCredentials() throws on a blank required field. The strict binding read let that through, so the engine overlay treated it as an unreadable workspace link and printed the raw Zod JSON on every run.
AltimateApi.getCredentials()throws a typedIncompleteCredentials("Altimate sign-in is incomplete (… must not be blank); sign in again") when the only problem is a blankaltimateUrl,altimateInstanceNameoraltimateApiKey(after${env:…}resolution). Any other fault still throws as before.readLocalBindingScopedStrict()readsIncompleteCredentialsas unbound (signed out), so the run behaves as it does with noaltimate.json: no warning, no refusal.backendConfig()(integrations CLI) returns null for it too, as it does for a missing file.- Bad JSON, an unset
${env:…}variable, a read error, or a blank field next to another schema fault still fail closed. A blank key still never loads the gateway as connected.
How did you verify your code works?
engine-overlay.test.ts: 8 new tests (each blank field, blank after env resolution, blanking while attached, and three fail-closed cases); 5 of them fail on main. 86 pass, 0 fail.datamate.test.tschecks the typed error and that no Zod JSON shows (54 pass);integrations.test.tsadds a blank-is-signed-out case forbackendConfigthat fails on main.- Real run with a blank
altimateInstanceNamein a scratch home: main printsWorkspace link could not be read: … ([ { "code": "custom", …before the reply; with this change nothing prints. tsgo --noEmitand the marker guard are clean.
Cost side effects
None.
Screenshots / recordings
CLI text only.
Checklist
- I have tested my changes locally
- I have not included unrelated changes in this PR
- I checked for cost side effects (model calls, queries or cloud resources that grow with user data) and described them, or wrote "none"
🤖 Generated with Claude Code
https://claude.ai/code/session_01BXxzvpym19ATbtFL8LaB6b
Summary by cubic
Fixes blank fields in altimate.json reading as an unreadable workspace link instead of a signed-out state, which printed raw Zod JSON on every run. Closes #1903.
getCredentials()now throws a typedIncompleteCredentials("sign in again") when only a required field is blank after${env:…}resolution; the strict binding read andbackendConfig()treat it as unbound, so runs behave as ifaltimate.jsonis missing.- Bad JSON, an unset
${env:…}variable, or a blank field alongside another schema fault still fail closed as before; a blank key still never loads the gateway as connected.
Summary by CodeRabbit
- Bug Fixes
- Blank or whitespace-only login details are now treated as signed out, rather than causing confusing credential errors.
- When login details are incomplete, workspace connections remain unbound, and existing user-managed connections are preserved.
- Invalid credential files and other credential errors continue to be reported as errors.