Commit d4fede1
fix(workspace, apps, shell): resolve the workspace WS endpoint from PUBLIC_WS_URL in one place, not sixteen literals
Org Workbench rendered its chrome and nothing else on augment.didi.sh: no
roster, no organizations, a red `closed` pill in the corner. The cause was a
single line repeated across the app tree — every remote declared
`const WS_URL = 'ws://localhost:3001/ws'` and never read the environment, so a
deployed surface opened its data socket against the *visitor's* laptop. It could
not have worked in production for two independent reasons: the host is wrong,
and `ws://` from an `https://` origin is blocked as mixed content. Local dev hid
it perfectly, because the operator's machine really is running
workspace-service on :3001. Three of the sixteen affected remotes are deployed,
which took down the whole Augment-from-DB flow rather than one surface.
The endpoint now has exactly one home. `packages/workspace/src/ws-url.ts`
exports `resolveWsUrl()` and `resolveHttpBase()`, and `TransportConfig.url`
becomes optional — omit it and the transport resolves from PUBLIC_WS_URL on
every connect attempt. That is the part that makes the bug structurally
unavailable: the failure mode was never a logic error, it was copy-paste into a
new remote, and the copy-pasteable thing no longer exists. Every call site was
converted, including the two that had quietly got it right (chat, and
corpora-curator's real client in curation.svelte.ts) so there is no second
pattern to imitate, and the WorkspaceSwitcher tooltip stops telling operators
that localhost is unreachable when the endpoint is somewhere else entirely.
Verified by building org-workbench with PUBLIC_WS_URL set and reading the
emitted bundle: the resolver compiles to the prod endpoint with localhost left
only as the dead fallback branch. A new guard in the workspace suite sweeps
apps/, shell/, and packages/ for the literal and fails with the offending
filenames; planting the old line back into org-workbench makes it fail, so it
is not vacuous. svelte-check is clean across all 17 surfaces.
Deploy note: PUBLIC_* is baked at build time, so the three deployed remotes need
a rebuild, not a restart, once their variables are set.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017HuzSPdPK4QEhs7eztHgoC1 parent 4b42030 commit d4fede1
24 files changed
Lines changed: 164 additions & 50 deletions
File tree
- apps
- affiliation-rating-resolver/src
- chat/src
- corpora-curator/src
- enhanced-records-list/src
- org-workbench/src
- pack-runner/src
- person-db-resolver/src
- prompt-template-manager/src
- record-collector/src
- record-db-resolver/src
- records-surface/src
- request-reviewer/src
- response-reviewer/src
- search-and-add/src
- search-results/src
- sort-filter-lens/src
- packages/workspace
- src
- test
- shell/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
20 | | - | |
| 18 | + | |
21 | 19 | | |
22 | 20 | | |
23 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
23 | | - | |
| 21 | + | |
24 | 22 | | |
25 | 23 | | |
26 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | 31 | | |
33 | 32 | | |
34 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
0 commit comments