Skip to content

fix(chat): safely steer an existing Gateway-queued input - #160275

Draft
roboclaw-bot wants to merge 3 commits into
mainfrom
openclaw/jev-queue-decision-missing-steer-option
Draft

roboclaw-bot wants to merge 3 commits into
mainfrom
openclaw/jev-queue-decision-missing-steer-option

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes: a message already held in the Gateway queue has no safe way to join compatible active work without being sent again.

User Impact

Authorized clients can attempt to steer the original queued input, including approved content and attachments. A definite refusal preserves its queue position; possible native commitment must not replay. No configuration, storage migration, or protocol-version bump is introduced.

Backend slice. The visible Control UI affordance is stacked follow-up #160593. This task does not authorize merging or deployment.

Why This Change Was Made

The current session controller remains the only custody owner. chat.steer selects the original source by session/run identity and prepared physical-store scope, uses the router's current session-access authority, and shares ordinary steering policy and native settlement. It neither reconstructs the message nor creates another queued input. Incompatible model or authority leaves the input queued.

Evidence

  • Registered Gateway flow uses real chat.send, the original prepared queued source, registered chat.steer, real session projection/authorization and SQLite; only the model backend is stubbed. It verifies one injection of original content, its original recorder, a completed original protocol receipt, no abandonment, source retirement, and no later execution.
  • Final standalone Gateway file: 5 passed, 31.54 s wall; the new composed case took 2.009 s. Discovery/authority selection: 24 passed.
  • Unchanged controller contracts: 31 + 1 passed. Automatic-fallback siblings: 35 passed; RPC schema: 7 passed (the latter selections completed in 119.07 s including setup).
  • Scoped production and canonical Gateway-test types passed; final typed owner lint passed. Canonical protocol generation, Swift/Kotlin generated-contract determinism and release-train metadata passed.
  • Independent local autoreview: complete selected local candidate against 63c25f72daff6906c011027195a3187c8d8b7f06, P0–P2, two native passes, no actionable findings. One subsequent test-only lint correction removed await from synchronous projection disposal; affected lint and the standalone regression passed afterward.
  • Inspected current-source before/after screenshots and UI scenario, also embedded in fix(ui): restore Steer for Gateway-queued inputs #160593 and delivered to the originating chat.

Limits: model delivery is simulated in boundary tests. No live-provider or installed-upgrade rehearsal was run. Native generated contracts were checked, not native application builds. Hosted checks must be read against the published head; local results are not current-head CI. The refreshed code and evidence are published; both PRs remain drafts under this build-PRs-only task.

Failure investigation and generated diff

The registered entry point caught a real wrong-owner defect despite an earlier static review: requiring the legacy mutation target rejected a valid current-router request as “conversation changed.” The handler now consumes current session-access authority and the existing prepared-read owner. The unchanged acceptance and settlement assertions pass after that repair.

Separate fixture defects were corrected without weakening product checks: reused ingress IDs collided with process-wide dedupe; the direct context lacked a ready row projection; and a hardcoded incumbent model differed from the actual configured incoming model, which production correctly refused. The fixture now uses a unique ID, real projection, and configured-model resolver. Earlier setup timeouts are not passing or product-failure evidence.

Most line churn is canonical generated-predicate renumbering. The independent review included those changes. The initial oversized review request failed before assessment; native partitioning retained the complete change and owner contracts within the transport limit. CI cost is unavailable until a run exists.

Reported by @vyctorbrzezowski.

Worked on by

Work sessions


View the OpenClaw team session

@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: android App: android app: web-ui App: web-ui gateway Gateway runtime size: XL labels Sep 28, 2026
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Before / after

Actual Control UI, identical synthetic conversation and queued input, 1280×900 desktop viewport. The before capture uses the shipped bundle; the after capture uses the fix. This is a mocked-Gateway UI fixture, not a live model run.

Before

The Gateway-queued row offers delete but no Steer action.

Before: Gateway-queued input has no Steer action

After

The same original queued input offers Steer beside delete.

After: Steer is available on the Gateway-queued input

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 28, 2026
@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 30, 2026, 11:47 PM ET / October 1, 2026, 03:47 UTC (Revision 5).

ClawSweeper review

What this changes

Adds a Gateway control that steers an original queued chat input into an active turn while preserving its attachments, identity, authorization, and rejection handling.

Merge readiness

⛔ Blocked before merge - 1 item remains

This PR remains useful: current main lacks the queued-input control, and the reviewed changes address the earlier custody and authorization concerns. No actionable introduced defect remains; the previous stored-format warning is unsupported by the actual diff.

Priority: P2
Reviewed head: efef44c34388a5b23de1c274d9ecbfec84b5166d

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent owner-based implementation with relevant boundary proof and no remaining actionable finding.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): Captured after-fix reports and inspected production-path harnesses exercise authenticated queued promotion, real transcript/SQLite owners, participant selection, and revoked authority before append or native submission. Model and app-server responses are controlled boundaries; no live provider is claimed. Screenshots apply only to the stacked UI. Stored formats remain unchanged, resolving the prior migration concern.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): Captured after-fix reports and inspected production-path harnesses exercise authenticated queued promotion, real transcript/SQLite owners, participant selection, and revoked authority before append or native submission. Model and app-server responses are controlled boundaries; no live provider is claimed. Screenshots apply only to the stacked UI. Stored formats remain unchanged, resolving the prior migration concern.
Evidence reviewed 10 items Pinned introduction and merge ownership: Reviewed the introduced merge-base-to-head changes. Raw test-merge records confirm the pinned base followed by the exact PR head; its result retains the queued-input changes without treating unrelated base drift as PR edits.
Still necessary on current main: Current main registers chat.send and chat.abort but no chat.steer. Its steering implementation parks newly submitted input and lacks the retained existing-source promotion control. The supplied related PR is an open stacked UI consumer, not a merged replacement.
Exact source and current requester authority: The handler validates the admitted session incarnation and original queued entry, then passes live request and session assertions into the source capability. The queue reserves the existing source without reconstructing its payload or re-enqueueing it.
Findings None None.
Security None None.

How this fits together

The Gateway admits chat inputs and queues them while an agent is busy. This control promotes an existing queued input through the agent’s established injection and transcript-writing paths, then reports its custody outcome.

flowchart TD
 A[Authorized chat client] --> B[Gateway session authorization]
 B --> C[Original queued input]
 C --> D[Reserve input in place]
 D --> E[Active agent injection]
 E --> F[Guarded transcript and transport]
 E --> G[Rejected input stays queued]
 F --> H[Custody receipt]
Loading

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source +504, Tests +1452, Docs +3, Other +27. Total +1986 across 41 files.

View PR surface stats
Area Files Added Removed Net
Source 25 772 268 +504
Tests 11 1947 495 +1452
Docs 2 3 0 +3
Config 0 0 0 0
Generated 0 0 0 0
Other 3 28 1 +27
Total 41 2750 764 +1986

Review metrics

Metric Value Why it matters
Public control surface 1 additive RPC; 0 new configuration options The control accepts original session and input identifiers rather than replacement payloads.
Production versus test growth production +531 net LOC; tests +1452 net LOC Production growth is justified by retained-source reservation and settlement; tests cover distinct queue, authorization, and transport boundaries.

Stored data model

Persistent data-model change detected: serialized state: extensions/codex/src/app-server/run-attempt-active-turn.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Keep queued promotion with the existing queue and injection owners, preserving exact source identity and live authority through definitive settlement.

Do we have a high-confidence way to reproduce the issue?

Not applicable as a new backend control: current-main source confirms that fresh steering exists but promotion of an already queued source is unavailable.

Is this the best way to solve the issue?

Yes. Extending the existing queue owner and guarded injection path avoids resending input or creating competing custody state.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 55fe1b488910.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This restores a bounded chat-control workflow without evidence of an urgent current outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): Captured after-fix reports and inspected production-path harnesses exercise authenticated queued promotion, real transcript/SQLite owners, participant selection, and revoked authority before append or native submission. Model and app-server responses are controlled boundaries; no live provider is claimed. Screenshots apply only to the stacked UI. Stored formats remain unchanged, resolving the prior migration concern.
  • proof: sufficient: Contributor real behavior proof is sufficient. Captured after-fix reports and inspected production-path harnesses exercise authenticated queued promotion, real transcript/SQLite owners, participant selection, and revoked authority before append or native submission. Model and app-server responses are controlled boundaries; no live provider is claimed. Screenshots apply only to the stacked UI. Stored formats remain unchanged, resolving the prior migration concern.

Evidence

What I checked:

  • Pinned introduction and merge ownership: Reviewed the introduced merge-base-to-head changes. Raw test-merge records confirm the pinned base followed by the exact PR head; its result retains the queued-input changes without treating unrelated base drift as PR edits. (2391b8d182d8)
  • Still necessary on current main: Current main registers chat.send and chat.abort but no chat.steer. Its steering implementation parks newly submitted input and lacks the retained existing-source promotion control. The supplied related PR is an open stacked UI consumer, not a merged replacement. (src/gateway/methods/core-descriptors.ts:369, 55fe1b488910)
  • Exact source and current requester authority: The handler validates the admitted session incarnation and original queued entry, then passes live request and session assertions into the source capability. The queue reserves the existing source without reconstructing its payload or re-enqueueing it. (src/gateway/server-methods/chat-steer-handler.ts:69, efef44c34388)
  • Authority checked at durable and transport effects: Per-input authority reaches persistApproved, the existing transcript write context, and the fresh-message commit callback. Codex submission revalidates surviving inputs immediately before physical transport writes. The inspected production-path harness covers an allowed append and revocation during target resolution or the pre-write hook, asserting zero unauthorized transcript rows and zero native steer requests. (extensions/codex/src/app-server/run-attempt.steering-authority.test.ts:47, efef44c34388)
  • Composed participant and personal-effect proof: The captured PR body reports passing composed Gateway proof. The inspected harness enters through authenticated chat.send, retains the source through runReplyAgent, and invokes chat.steer; incompatible permissions leave input queued, while equal-permission participants retain their own identity. Unqualified personal effects reject ambiguity and explicitly selected effects target only the selected participant. (src/gateway/server-methods/chat-send-steering-participants.test.ts:465, efef44c34388)
  • Reservation and recovery regression coverage: The added cases protect FIFO fallback, collect-drain snapshots, stale-drain transfer, callback failures, and accepted custody without replay. The current-head recovery regression prevents stalled-turn recovery from claiming a reserved source or skipping it for a later sibling; the captured body reports the failing sequence before repair and 25 passing queue cases afterward. (src/auto-reply/reply/queue/enqueue.steering.test.ts:191, efef44c34388)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Ayaan Zaidi: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (4 earlier review cycles)
  • reviewed 2026-09-28T08:18:30.600Z sha 2d43ca6 :: needs real behavior proof before merge. :: [P1] Preserve queued custody until Codex steering is definitive | [P1] Recheck requester authority before Codex transcript admission | [P3] Update the Control UI chat guide for Gateway-queued Steer
  • reviewed 2026-09-28T17:49:52.739Z sha e26167e :: needs real behavior proof before merge. :: [P1] Check steering authority before the Codex transcript write | [P1] Recheck reservations when a collect drain resumes | [P1] Settle a reservation when recovery replaces its queue
  • reviewed 2026-09-28T21:34:23.429Z sha f3947e2 :: blocked before merge. :: none
  • reviewed 2026-09-28T22:29:14.315Z sha f3947e2 :: blocked before merge. :: none

@roboclaw-bot roboclaw-bot changed the title fix(chat): keep Steer available for Gateway-queued messages fix(chat): safely steer an existing Gateway-queued input Sep 28, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. labels Sep 28, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Sep 28, 2026
@roboclaw-bot
roboclaw-bot force-pushed the openclaw/jev-queue-decision-missing-steer-option branch from f3947e2 to efef44c Compare October 1, 2026 03:35
@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. label Oct 1, 2026
@jorge-monalee

Copy link
Copy Markdown
Contributor

Here's the data-model compatibility proof from the open ClawSweeper item. This PR doesn't change anything that's stored.

Diff check (00f3a20 → efef44c)

  • No file under src/state/ or src/config/ changes, and neither does any migration, SQLite schema or config schema.
  • Every field this PR adds to a queued or transcript type is a function: FollowupRun.steer, QueuedChatTurnEntry.steer, TurnAdoptionLifecycle.holdSteering, and assertCurrent on persistApproved and PersistUserTurnTranscriptParams. They exist only at runtime, next to callbacks those types already have, such as turnAdoptionLifecycle.onAdopted and holdPendingInputWithdrawal.
  • The flagged change in run-attempt-active-turn.ts moves the persistApproved() call from the batch beforeSubmit loop into a per-message commitMessage callback and passes assertCurrent. It writes the same row.
  • chat.steer is a new RPC. It doesn't change any existing method or stored record.

Run check
I ran one throwaway test, unchanged, on the base (00f3a20) and on this PR (efef44c). It stages a queued input and steers it into an active Codex turn through messageInjectionV2.queueMessage, which writes to a real SQLite agent database. Then it dumps that database: the schema, user_version, and every row, with UUIDs, timestamps and temp paths normalized.

Output Base vs. PR
SQLite schema (178 objects) and user_version (24) Identical
Every row in the 19 non-empty tables, including transcript_events Identical, except transcript_rewrite_watermarks.generation, a random token from randomUUID() that changes on every run
Transcript read back through readSessionTranscriptEvents Identical
turn/steer request sent to Codex Identical

Both builds write the same schema and the same rows, so either one reads a database written by the other. Upgrading or rolling back needs no migration.

Limits: the Codex app-server is the existing test harness, not a live provider. The steered message is text only, with no attachments.

How to rerun it
  1. Add "extensions/codex/src/app-server/run-attempt.datamodel-proof.test.ts" to databaseWorkerExtensionTestFiles in test/vitest/vitest.extension-database-workers-paths.mjs. Without it, the test fails during cleanup with "Shared-state admission requires the host broker".
  2. On each revision, run PROOF_OUT=/tmp/proof/<rev> pnpm test extensions/codex/src/app-server/run-attempt.datamodel-proof.test.ts.
  3. Run node dump-db.mjs /tmp/proof/<rev>/db/commit.sqlite > <rev>.json, then diff the two outputs.

extensions/codex/src/app-server/run-attempt.datamodel-proof.test.ts:

// Throwaway proof for openclaw/openclaw#160275: run unchanged on the PR base and head,
// then diff the normalized dumps. Not part of the PR.
import { copyFileSync, existsSync, mkdirSync, readdirSync, statSync, writeFileSync } from "node:fs";
import path from "node:path";
import { expectDefined } from "@openclaw/normalization-core";
import type { setActiveEmbeddedRun } from "openclaw/plugin-sdk/agent-harness-runtime";
import { createDeferred } from "openclaw/plugin-sdk/extension-shared";
import { loadUserTurnTranscriptRecorderFactoryForTest } from "openclaw/plugin-sdk/plugin-test-runtime";
import { readSessionTranscriptEvents } from "openclaw/plugin-sdk/session-transcript-runtime";
import { describe, expect, it, vi } from "vitest";
import { isJsonObject } from "./protocol.js";
import {
  createStartedThreadHarness,
  createTestParams,
  runCodexAppServerAttempt,
  setupRunAttemptTestHooks,
} from "./run-attempt-test-harness.js";
import { attachSqliteSessionTarget } from "./sqlite-session.test-helpers.js";

const registrations = vi.hoisted(() => vi.fn());

vi.mock("openclaw/plugin-sdk/agent-harness-runtime", async (importOriginal) => {
  const actual = await importOriginal<typeof import("openclaw/plugin-sdk/agent-harness-runtime")>();
  return {
    ...actual,
    setActiveEmbeddedRun: (...args: Parameters<typeof actual.setActiveEmbeddedRun>) => {
      registrations(...args);
      return actual.setActiveEmbeddedRun(...args);
    },
  };
});

setupRunAttemptTestHooks();

function normalizeText(text: string, tmp: string): string {
  return text
    .replaceAll(tmp, "<tmp>")
    .replace(/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi, "<uuid>")
    .replace(/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?Z/g, "<iso>")
    .replace(/(?<![\d.])1[78]\d{11}(?![\d.])/g, "<ts>");
}

function normalize(value: unknown, tmp: string): unknown {
  return JSON.parse(
    JSON.stringify(value, (_key, v) => {
      if (typeof v === "bigint") {
        v = Number(v);
      }
      if (typeof v === "number" && v > 1e12 && v < 2e12) {
        return "<ts>";
      }
      if (typeof v === "string") {
        // Stored JSON columns are normalized as parsed values, so key order and volatile ids compare cleanly.
        if (/^[[{]/.test(v)) {
          try {
            return { json: normalize(JSON.parse(v), tmp) };
          } catch {}
        }
        return normalizeText(v, tmp);
      }
      if (v instanceof Uint8Array) {
        return `<blob ${v.byteLength} bytes>`;
      }
      return v;
    }),
  );
}

function findSqliteFiles(dir: string): string[] {
  return readdirSync(dir).flatMap((name) => {
    const file = path.join(dir, name);
    if (statSync(file).isDirectory()) {
      return findSqliteFiles(file);
    }
    return /\.(sqlite|db)$/.test(name) ? [file] : [];
  });
}

describe("data-model compatibility proof", () => {
  it("records the stored state of one queued input steered into a Codex turn", async () => {
    const out = expectDefined(process.env.PROOF_OUT, "PROOF_OUT");
    registrations.mockReset();
    const params = createTestParams();
    const tmp = path.dirname(params.workspaceDir);
    await attachSqliteSessionTarget(
      params,
      path.join(params.workspaceDir, "commit.sqlite"),
      "commit-authority",
    );
    const target = {
      ...expectDefined(params.sessionTarget, "session target"),
      agentId: "main",
      sessionId: params.sessionId,
      sessionKey: expectDefined(params.sessionKey, "session key"),
      sessionEntry: undefined,
    };
    const createRecorder = await loadUserTurnTranscriptRecorderFactoryForTest();
    const registered = createDeferred<Parameters<typeof setActiveEmbeddedRun>[1]>();
    registrations.mockImplementation(
      (id: string, handle: Parameters<typeof setActiveEmbeddedRun>[1]) => {
        if (id === params.sessionId) {
          registered.resolve(handle);
        }
      },
    );
    const text = "Use metric units.";
    const recorder = createRecorder({
      input: { text, timestamp: 1, idempotencyKey: "queued-source:user" },
      target: async () => target,
    });
    expect(
      await recorder.stageApproved?.({ runId: "queued-source", assertCurrent: () => {} }),
    ).toBe(true);
    const harness = createStartedThreadHarness();
    const run = runCodexAppServerAttempt(params);
    let completed = false;
    try {
      const handle = await registered.promise;
      const delivery = expectDefined(handle.messageInjectionV2, "V2 injection").queueMessage(
        text,
        { debounceMs: 0, isInboundUserMessage: true, userTurnTranscriptRecorder: recorder },
        () => {},
        "source-bound",
      );
      await harness.waitForMethod("turn/steer");
      const request = expectDefined(
        harness.requests.find((entry) => entry.method === "turn/steer"),
        "steer request",
      );
      const wire = expectDefined(
        isJsonObject(request.params) ? request.params : undefined,
        "wire parameters",
      );
      await harness.notify({
        method: "item/completed",
        params: {
          threadId: "thread-1",
          turnId: "turn-1",
          item: { id: "steered-source", type: "userMessage", clientId: wire.clientUserMessageId },
        },
      });
      await delivery;
      expect(recorder.hasPersisted()).toBe(true);
      const events = await readSessionTranscriptEvents({
        agentId: "main",
        sessionId: params.sessionId,
        sessionKey: target.sessionKey,
        storePath: target.storePath,
      });
      completed = true;
      await harness.completeTurn({ threadId: "thread-1", turnId: "turn-1" });
      await run;
      mkdirSync(path.join(out, "db"), { recursive: true });
      writeFileSync(
        path.join(out, "steer-request.json"),
        `${JSON.stringify(normalize(request.params, tmp), null, 2)}\n`,
      );
      writeFileSync(
        path.join(out, "transcript-events.json"),
        `${JSON.stringify(normalize(events, tmp), null, 2)}\n`,
      );
      // Copy the stored files; they are dumped outside the test so this test never opens them itself.
      for (const file of findSqliteFiles(tmp)) {
        for (const suffix of ["", "-wal", "-shm"]) {
          if (existsSync(file + suffix)) {
            copyFileSync(file + suffix, path.join(out, "db", path.basename(file) + suffix));
          }
        }
      }
    } finally {
      if (!completed) {
        await harness.completeTurn({ threadId: "thread-1", turnId: "turn-1" });
        await run;
      }
    }
  });
});

dump-db.mjs:

// Usage: node dump-db.mjs <copied.sqlite> > dump.json
// Dumps schema, user_version and every row with volatile ids/timestamps normalized.
import { DatabaseSync } from "node:sqlite";

function normalizeText(text) {
  return text
    .replace(/\/[^"\s]*openclaw-codex-run-[^/"\s]*/g, "<tmp>")
    .replace(/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi, "<uuid>")
    .replace(/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?Z/g, "<iso>")
    .replace(/(?<![\d.])1[78]\d{11}(?![\d.])/g, "<ts>");
}

function normalize(value) {
  return JSON.parse(
    JSON.stringify(value, (_key, v) => {
      if (typeof v === "bigint") v = Number(v);
      if (typeof v === "number" && v > 1e12 && v < 2e12) return "<ts>";
      if (typeof v === "string") {
        if (/^[[{]/.test(v)) {
          try {
            return { json: normalize(JSON.parse(v)) };
          } catch {}
        }
        return normalizeText(v);
      }
      if (v instanceof Uint8Array) return `<blob ${v.byteLength} bytes>`;
      return v;
    }),
  );
}

const db = new DatabaseSync(process.argv[2]);
const schema = db
  .prepare("SELECT type, name, tbl_name, sql FROM sqlite_master ORDER BY type, name")
  .all();
const tables = {};
for (const { type, name } of schema) {
  if (type !== "table" || name.startsWith("sqlite_")) continue;
  const rows = db.prepare(`SELECT * FROM "${name}"`).all();
  if (rows.length > 0) tables[name] = rows;
}
const userVersion = db.prepare("PRAGMA user_version").get().user_version;
db.close();
console.log(JSON.stringify(normalize({ userVersion, schema, tables }), null, 2));

This also unblocks iOS. We closed #187078 so queued messages stay in the Gateway queue, and the iOS Steer action will use chat.steer once this lands.

roboclaw-bot and others added 3 commits November 2, 2026 15:01
Reuse current session access, prepared row facts, and the original controller source. Preserve FIFO fallback and settle possible native commitment without replay.

Co-authored-by: vyctorbrzezowski <[email protected]>
Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: 5f4eda6b-790e-4ee8-be00-d1b7fca07518
Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: afc43178-e2a4-4b2c-9c5e-f01e61b947f4
@roboclaw-bot
roboclaw-bot force-pushed the openclaw/jev-queue-decision-missing-steer-option branch from efef44c to 3b8a4bb Compare November 2, 2026 15:13
@roboclaw-bot

roboclaw-bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator Author

Current-source queued-input Steer proof

Synthetic data. Real source Control UI in Chromium with a mock Gateway; base 63c25f72daff6906c011027195a3187c8d8b7f06 versus the refreshed UI candidate. The narrow inspected crops exclude unrelated UI/model-picker details. This is UI boundary evidence, not a live-provider or upgrade rehearsal.

Before: the Gateway-held queued chip has no Steer action.

Before: Gateway-held queued message without Steer

After: the same custody state exposes Steer. The browser scenario also exercised identity-only control, busy state, custody retirement and retained draft text.

After: Steer remains available on a Gateway-held queued message

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants