@contextableai/clawg-ui 0.2.6 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.7 (2026-02-18)
4
+
5
+ ### Fixed
6
+ - Close open text messages before emitting `RUN_FINISHED` in `splitRunIfToolFired()` — fixes `AGUIError: Cannot send 'RUN_FINISHED' while text messages are still active` when text streaming is followed by a server-side tool call and then more text
7
+
3
8
  ## 0.2.6 (2026-02-10)
4
9
 
5
10
  ### Fixed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contextableai/clawg-ui",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
4
4
  "description": "AG-UI protocol channel plugin for OpenClaw — connect CopilotKit and AG-UI clients to your OpenClaw gateway",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -380,6 +380,15 @@ export function createAguiHttpHandler(api: OpenClawPluginApi) {
380
380
  if (!wasToolFiredInRun(sessionKey)) {
381
381
  return;
382
382
  }
383
+ // Close any open text message before ending the run
384
+ if (messageStarted) {
385
+ writeEvent({
386
+ type: EventType.TEXT_MESSAGE_END,
387
+ messageId: currentMessageId,
388
+ runId: currentRunId,
389
+ });
390
+ messageStarted = false;
391
+ }
383
392
  // End the tool run
384
393
  writeEvent({
385
394
  type: EventType.RUN_FINISHED,
@@ -0,0 +1,28 @@
1
+ # Integration Test Setup
2
+
3
+ To run integration tests against the local gateway:
4
+
5
+ 1. Initiate device pairing:
6
+ ```bash
7
+ curl -X POST http://localhost:18789/v1/clawg-ui \
8
+ -H "Content-Type: application/json" \
9
+ -d '{"messages":[{"role":"user","content":"test"}]}'
10
+ ```
11
+
12
+ 2. Copy the pairing code from the 403 response
13
+
14
+ 3. Approve the device:
15
+ ```bash
16
+ openclaw pairing approve clawg-ui <pairing-code>
17
+ ```
18
+
19
+ 4. Copy the device token from step 1's response
20
+
21
+ 5. Run tests with the device token:
22
+ ```bash
23
+ OPENCLAW_SERVER_URL="http://localhost" \
24
+ OPENCLAW_GATEWAY_TOKEN="<device-token>" \
25
+ npm test
26
+ ```
27
+
28
+ **Note**: The OPENCLAW_GATEWAY_TOKEN env var name is misleading in the integration tests - it should be renamed to OPENCLAW_DEVICE_TOKEN in a future update.