-
Notifications
You must be signed in to change notification settings - Fork 12
Fix AI bot messages rendered as user messages on staging #4253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
habdelra
merged 8 commits into
main
from
cs-10535-investigate-broken-code-formatting-in-staging
Mar 26, 2026
+237
−51
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
4d2ef12
Fix AI bot messages rendered as user messages due to matrixServerName…
jurgenwerk 9944eaf
Fix software factory cache prepare in worktrees
habdelra 95f442e
Fix host serve config path
habdelra 0cefad2
Use absolute host serve paths
habdelra 14fb47f
Merge remote-tracking branch 'origin/main' into fix-pr-4253-software-…
habdelra 7b1ed80
Fix software factory harness collisions
habdelra 61977b7
Address PR review feedback
habdelra 65fe8c2
Fix realm server lint shard list
habdelra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| import { module, test } from 'qunit'; | ||
| import { basename } from 'path'; | ||
| import { dirSync } from 'tmp'; | ||
|
|
||
| import { RealmServer } from '../server'; | ||
|
|
||
| module(basename(__filename), function () { | ||
| test('prefers MATRIX_SERVER_NAME over matrix URL hostname in host config', async function (assert) { | ||
| let originalMatrixServerName = process.env.MATRIX_SERVER_NAME; | ||
| let tempDir = dirSync({ unsafeCleanup: true }); | ||
|
|
||
| process.env.MATRIX_SERVER_NAME = 'stack.cards'; | ||
|
|
||
| try { | ||
| let server = new RealmServer({ | ||
| serverURL: new URL('http://127.0.0.1:4448'), | ||
| realms: [], | ||
| virtualNetwork: {} as any, | ||
| matrixClient: { | ||
| matrixURL: new URL('http://localhost:8008/'), | ||
| } as any, | ||
| realmServerSecretSeed: 'test-realm-server-secret', | ||
| realmSecretSeed: 'test-realm-secret', | ||
| grafanaSecret: 'test-grafana-secret', | ||
| realmsRootPath: tempDir.name, | ||
| dbAdapter: {} as any, | ||
| queue: {} as any, | ||
| definitionLookup: {} as any, | ||
| assetsURL: new URL('http://example.com/notional-assets-host/'), | ||
| matrixRegistrationSecret: 'test-matrix-registration-secret', | ||
| getIndexHTML: async () => | ||
| `<html><head><meta name="@cardstack/host/config/environment" content="${encodeURIComponent( | ||
| JSON.stringify({ | ||
| matrixURL: 'http://localhost:8008', | ||
| matrixServerName: 'localhost', | ||
| realmServerURL: 'http://localhost:4201/', | ||
| publishedRealmBoxelSpaceDomain: 'localhost:4201', | ||
| publishedRealmBoxelSiteDomain: 'localhost:4201', | ||
| }), | ||
| )}"></head><body></body></html>`, | ||
| }); | ||
|
|
||
| let html = await (server as any).retrieveIndexHTML(); | ||
| let match = html.match( | ||
| /<meta name="@cardstack\/host\/config\/environment" content="([^"]+)">/, | ||
| ); | ||
|
|
||
| assert.ok(match, 'host config environment meta tag is present'); | ||
|
|
||
| let config = JSON.parse(decodeURIComponent(match![1])); | ||
| assert.strictEqual( | ||
| config.matrixServerName, | ||
| 'stack.cards', | ||
| 'uses MATRIX_SERVER_NAME override in host config', | ||
| ); | ||
| } finally { | ||
| if (originalMatrixServerName == null) { | ||
| delete process.env.MATRIX_SERVER_NAME; | ||
| } else { | ||
| process.env.MATRIX_SERVER_NAME = originalMatrixServerName; | ||
| } | ||
| tempDir.removeCallback(); | ||
| } | ||
| }); | ||
| }); |
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.