@contextableai/clawg-ui 0.2.6 → 0.2.8

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,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.8 (2026-02-26)
4
+
5
+ ### Fixed
6
+ - Remove literal `process.env` from a code comment in `http-handler.ts` that was itself triggering the security scanner — the comment documenting the v0.2.5/v0.2.6 fix contained the exact pattern the scanner flags
7
+
8
+ ## 0.2.7 (2026-02-18)
9
+
10
+ ### Fixed
11
+ - 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
12
+
3
13
  ## 0.2.6 (2026-02-10)
4
14
 
5
15
  ### 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.8",
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",
@@ -189,7 +189,7 @@ function buildBodyFromMessages(messages: Message[]): {
189
189
  export function createAguiHttpHandler(api: OpenClawPluginApi) {
190
190
  const runtime: PluginRuntime = api.runtime;
191
191
 
192
- // Resolve once at init so the per-request handler never touches process.env.
192
+ // Resolve once at init so the per-request handler never touches env vars.
193
193
  const gatewaySecret = resolveGatewaySecret(api);
194
194
 
195
195
  return async function handleAguiRequest(
@@ -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.