Repository navigation
Commit d966b88
authored
fix(opengenui): define the ready-DOM initialization contract (#7662)
A generated calculator could render correctly while every button
remained inert: its `jsExpressions` registered `DOMContentLoaded` after
Websandbox had already loaded the document. This is a shared
generation-contract gap, not a LangGraph TypeScript adapter failure.
Centralize the React, Angular, and Vue tool description in
`@copilotkit/shared` and explicitly require direct initialization
against the ready DOM. Helpers belong in `jsFunctions`; the first
expression initializes controls once. Existing sandbox protections and
renderer execution semantics are unchanged. Historical payloads that
wait for a past event must be regenerated; this change neither rewrites
saved JavaScript nor redispatches readiness events.
Validation:
- Reproduced the captured failing calculator in real Chromium: clicking
`2` left `0`.
- Five real-browser tests pass against both source and exact-commit
packed React/shared artifacts: failing-payload characterization,
supported streaming/replay, once-only initialization, reopening, `2 + 3
= 5`, metric shortcuts, and blocked host/storage access.
- Generated an unmodified `gpt-5-mini` response using the normal
Calculator App suggestion and updated tool description; both streaming
and replay compute `5` and insert the revenue shortcut. Captured it as a
deterministic CI fixture. This is direct real-model generation plus
real-renderer testing, not an end-to-end LangGraph agent transport run.
- Shared, React, Angular, and Vue: builds, explicit typechecks, 3,985
unit tests, publint, and packed type-export checks pass. One
pre-existing Vue test remains skipped.
- Formatting, frozen lockfile, and scoped lint pass (two existing React
provider warnings). Browser regression added to the Node 22 / React 19
CI lane.
The pre-commit hook expanded the lockfile change to 40 projects and
failed on unavailable dependencies/native toolchains outside this narrow
change. Its `test-packages` tag was excluded only after explicitly
running the changed-package checks above; other hooks ran normally.
Fixes PNI-585.
Validated hosted preview (`ba41e270e0875ddd3a45fe1b480e09ff09465a2e`):
-
[shared](https://pkg.pr.new/@copilotkit/shared@ba41e270e0875ddd3a45fe1b480e09ff09465a2e)
-
[react-core](https://pkg.pr.new/@copilotkit/react-core@ba41e270e0875ddd3a45fe1b480e09ff09465a2e)
-
[angular](https://pkg.pr.new/@copilotkit/angular@ba41e270e0875ddd3a45fe1b480e09ff09465a2e)
-
[vue](https://pkg.pr.new/@copilotkit/vue@ba41e270e0875ddd3a45fe1b480e09ff09465a2e)
The downloaded hosted React/shared packages also passed all five
Chromium tests. Install React and shared together. These are fresh-main
artifacts; cherry-pick this commit onto the combined validator candidate
to retain its other pending fixes.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Improvements**
* Newly generated interactive UI follows updated initialization guidance
for live updates and replay.
* **Tests**
* Added browser-based coverage for calculator rendering, interactions,
replay behavior, and sandbox restrictions.
* Added automated browser-test runs for eligible React 19 and Node 22
checks.
* **Documentation**
* Added guidance on running the browser regression suite and what it
covers.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Review follow-up (`289830b0bb`): convert the browser harness file URL
using `fileURLToPath`, so paths with spaces and Windows filesystem paths
are handled correctly. Reproduced the previous server-start failure in a
directory containing spaces; all five Chromium tests pass there after
the fix. This follow-up only changes test configuration; production
package sources are unchanged from the validated preview above.15 files changed
Lines changed: 332 additions & 42 deletions
File tree
- .github/workflows
- packages
- angular/src/lib
- react-core
- browser
- fixtures
- src/v2/providers
- vue/src/v2/providers
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
274 | 282 | | |
275 | 283 | | |
276 | 284 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
| 19 | + | |
32 | 20 | | |
33 | 21 | | |
34 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
0 commit comments