Skip to content

fix: let the first message after a Control UI reconnect author skills and answer pending questions - #204698

Merged
obviyus merged 1 commit into
mainfrom
fix/reconnect-marker-readers
Nov 24, 2026
Merged

obviyus merged 1 commit into
mainfrom
fix/reconnect-marker-readers

Conversation

@obviyus

@obviyus obviyus commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

Related: #167867, #204669

What Problem This Solves

After the Control UI reconnects its socket, the first message you type carries a reconnect marker (__controlUiReconnectResume). Three Gateway checks still read that marker as "this is not fresh input":

  1. Skill authoring: that one message gets no skill-library grant. If you ask the agent to save or update a skill, skill_library answers "Skill authoring needs a fresh message from the person requesting the change." The messages before and after it work.
  2. Pending questions: while the agent waits on a multi-part, secret or required_action question, a steer message normally replaces that question. The first steer after a reconnect does not, so the run stays blocked on the question.
  3. Goal start: a goal start with the marker is rejected. The Control UI never sends the marker with a goal start, so this refusal cannot be reached.

This is the same class as #204669 (the cron creator admission). Each send is admitted on its own when it starts. The marker must not change what new input can do.

User Impact

The first message after a reconnect can save or update skills and can replace a pending question, the same as any other message.

Why This Change Was Made

The three reads are deleted. No new code. Production lines: +2/−5.

Replay dedupe does not depend on the marker: a repeated idempotencyKey is answered from the chat-send dedupe cache (chat-send-pre-admission.ts).

Kept on purpose: the marker still reaches chat-user-turn-recorder.ts → resumeRequestedSession, which skips idle/daily session rollover when the reconnecting tab sends the session's current sessionId (#89017, "sessions persist after reconnects"). That is a session-lifecycle choice, not admission: it does not change tools, questions, goals or skills. So the marker itself stays.

Accepted edge case: an outbox message typed before a question appeared, and first sent after a reconnect, now also replaces that question, like any other steer.

Evidence

  • Real Gateway, real model (gpt-5.5), head 66301b8523: an admin Control UI client asks the agent to call skill_library list on turn A (fresh), turn B (after a socket reconnect, with __controlUiReconnectResume: true and the same sessionId) and turn C (fresh). All three tool results list the library. On main 4164dcb200af, turn B returned {"status":"error","error":"Skill authoring needs a fresh message from the person requesting the change."}. The check now reads the tool result, not the model's reply.
  • Red on base, green on head:
    • chat-send-session-binding.test.ts › "grants skill authoring to the first message typed after a Control UI reconnect": a direct Control UI admin chat.send with the marker and the session's sessionId gets skillLibraryAuthoring. On merge base 500e19e4490b: expected undefined to be defined.
    • chat-send-question-replacement.test.ts › reconnect-resume row: a reconnect-resumed steer replaces a pending multi-part question. On merge base: expected false to be true.
  • Pre-push: 11 test files (touched tests and direct importers of the changed sources), 206 tests, all pass. pnpm tsgo:core, pnpm tsgo:test, oxfmt and oxlint on the changed files: clean.
  • One-admission E2E (Q/R/S) and local review results: see comments.

The Control UI reconnect marker no longer withholds the skill-library
authoring grant, no longer keeps a steer from replacing a pending
multi-part or secret question, and no longer rejects a goal start.
Session rollover on resume still reads it.

Co-authored-by: obviyus <[email protected]>
@clawsweeper

clawsweeper Bot commented Nov 24, 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 gateway Gateway runtime size: S labels Nov 24, 2026
@obviyus

obviyus commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator Author

E2E on exact head 66301b8523:

  • One-admission E2E (real Gateway, real model): Q queued input refused visibly ✅, R running turn finishes ✅, S Stop cancels ✅ (verdict.json pass: true, elapsed 58 s; results.jsonl kept with the run evidence).
  • Reconnect skill case (Z1 harness): turn A (fresh), B (after reconnect, __controlUiReconnectResume: true, same sessionId) and C (fresh) all return the library listing from skill_library ({"entries":[],...}). On main, B returned "Skill authoring needs a fresh message from the person requesting the change."
  • Local ClawSweeper review on 66301b8523: complete, patch is correct, no findings.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 24, 2026
@obviyus
obviyus merged commit 15b7df3 into main Nov 24, 2026
115 checks passed
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Nov 24, 2026
@obviyus
obviyus deleted the fix/reconnect-marker-readers branch November 24, 2026 14:57
@obviyus

obviyus commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator Author

Landed as 15b7df3. The first message after a Control UI reconnect now gets the skill-library grant and can replace a pending multi-part or secret question. The dead goal-start refusal is gone. Proof: two tests red on base and green on head, a real-Gateway run where A/B/C all list the skill library, one-admission E2E Q/R/S pass, CI green on the first round, local review clean. The session-rollover read (#89017) keeps the marker.

@clawsweeper

clawsweeper Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR lets reconnect-marked Control UI messages receive normal skill-authoring authority and replace pending questions, while removing an unreachable Goal restriction.

Example: After reconnecting, an authenticated user sends “Save this workflow as a skill” in the existing conversation.

  • Before: The reconnect marker prevents that turn from receiving skill-authoring authority.
  • After: The turn receives the same authoring eligibility as an ordinary authenticated message.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) A focused, justified patch with useful regression coverage and partial live behavior evidence.
Proof confidence 🦪 silver shellfish (2/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: The first message after a Control UI reconnect cannot author skills or replace certain pending questions.
Reason: The maintainer-authored direction restores ordinary authenticated-input behavior and follows the admission decision recorded in the merged predecessor.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR fixes reconnect-specific restrictions still present on main, and no introduced correctness or security defect was found.

Priority: P2
Reviewed head: 66301b8523f5b7bd06069abef7be8ffea4c2c044

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Supply redacted live output or a recording showing a reconnect-marked steer replacing a pending multi-part question and the asking run continuing; redact credentials and private endpoints.
Agent review details

How this fits together

Control UI sends enter Gateway chat normalization and admission, then reach the existing skill-library or question owners; the reconnect marker separately preserves matching-session lifecycle behavior.

flowchart TD
  A[Control UI message] --> B[Chat request normalization]
  B --> C[Existing request admission]
  C --> D[Skill library authority]
  C --> E[Pending question owner]
  B --> F[Matching session resume]
Loading

Technical review

Best possible solution:

Remove the reconnect-specific capability exclusions while retaining existing admission, question ownership, deduplication and matching-session resume behavior.

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

Current-main source directly shows the reconnect exclusions, and the author reports live skill-library failure plus base-failing regressions; this read-only review executed no reproduction.

Is this the best way to solve the issue?

The patch is the smallest complete source fix: reconnect state describes session continuity, while the existing admission and capability owners already decide authority.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Skill-authoring human-turn classification changes intended behavior with a stated reason (unknown: The exclusion is carried through the incognito extraction in 3de654b; the original library feature ties authoring to live requester authority, but unavailable historical blobs prevented establishing why reconnect input was originally excluded.)
  • Pending-question replacement changes intended behavior with a stated reason (691d0cd: The merged typed-reply repair makes the Gateway own answer-versus-replacement decisions while preserving child-session and protected-form boundaries; this PR explains why reconnect state should not suppress that owner.)
  • Goal-start request validation changes intended behavior with a stated reason (0474704: Goal starts reject transient routing and runtime overrides because recovery uses persisted input and session settings; the UI omits reconnect markers for Goal starts, and reconnect state is not such an override.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit b958fb6 adds src/gateway/server-methods/chat-send-request.ts:70 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: b958fb688207; files: src/gateway/server-methods/chat-send-request.ts)

PR surface

Source -6, Tests +59. Total +53 across 5 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 3 3 9 -6
Tests 2 61 2 +59
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 64 11 +53

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Production versus regression coverage Production +3/-9; tests +61/-2 The production change deletes eligibility restrictions; test growth covers distinct skill-authority and pending-question failures using existing fixtures.

Labels

Label changes:

  • add P2: The first message after reconnect has a bounded capability and question-replacement failure; ordinary subsequent messages remain available.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: The first message after reconnect has a bounded capability and question-replacement failure; ordinary subsequent messages remain available.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 24, 2026, 9:56 AM ET / 14:56 UTC.

tideclaw-bot pushed a commit that referenced this pull request Nov 25, 2026
… and answer pending questions (#204698)

Related: #167867, #204669

## What Problem This Solves

After the Control UI reconnects its socket, the first message you type carries a reconnect marker (`__controlUiReconnectResume`). Three Gateway checks still read that marker as "this is not fresh input":

1. **Skill authoring:** that one message gets no skill-library grant. If you ask the agent to save or update a skill, `skill_library` answers "Skill authoring needs a fresh message from the person requesting the change." The messages before and after it work.
2. **Pending questions:** while the agent waits on a multi-part, secret or `required_action` question, a steer message normally replaces that question. The first steer after a reconnect does not, so the run stays blocked on the question.
3. **Goal start:** a goal start with the marker is rejected. The Control UI never sends the marker with a goal start, so this refusal cannot be reached.

This is the same class as #204669 (the cron creator admission). Each send is admitted on its own when it starts. The marker must not change what new input can do.

## User Impact

The first message after a reconnect can save or update skills and can replace a pending question, the same as any other message.

## Why This Change Was Made

The three reads are deleted. No new code. Production lines: +2/−5.

Replay dedupe does not depend on the marker: a repeated `idempotencyKey` is answered from the chat-send dedupe cache (`chat-send-pre-admission.ts`).

Kept on purpose: the marker still reaches `chat-user-turn-recorder.ts` → `resumeRequestedSession`, which skips idle/daily session rollover when the reconnecting tab sends the session's current `sessionId` (#89017, "sessions persist after reconnects"). That is a session-lifecycle choice, not admission: it does not change tools, questions, goals or skills. So the marker itself stays.

Accepted edge case: an outbox message typed before a question appeared, and first sent after a reconnect, now also replaces that question, like any other steer.

## Evidence

- **Real Gateway, real model (gpt-5.5), head `66301b8523`:** an admin Control UI client asks the agent to call `skill_library list` on turn A (fresh), turn B (after a socket reconnect, with `__controlUiReconnectResume: true` and the same `sessionId`) and turn C (fresh). All three tool results list the library. On main `4164dcb200af`, turn B returned `{"status":"error","error":"Skill authoring needs a fresh message from the person requesting the change."}`. The check now reads the tool result, not the model's reply.
- **Red on base, green on head:**
  - `chat-send-session-binding.test.ts` › "grants skill authoring to the first message typed after a Control UI reconnect": a direct Control UI admin `chat.send` with the marker and the session's `sessionId` gets `skillLibraryAuthoring`. On merge base `500e19e4490b`: `expected undefined to be defined`.
  - `chat-send-question-replacement.test.ts` › `reconnect-resume` row: a reconnect-resumed steer replaces a pending multi-part question. On merge base: `expected false to be true`.
- Pre-push: 11 test files (touched tests and direct importers of the changed sources), 206 tests, all pass. `pnpm tsgo:core`, `pnpm tsgo:test`, oxfmt and oxlint on the changed files: clean.
- One-admission E2E (Q/R/S) and local review results: see comments.

Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit 15b7df3)
Co-authored-by: RomneyDa <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 25, 2026
… and answer pending questions (openclaw#204698)

Related: openclaw#167867, openclaw#204669

## What Problem This Solves

After the Control UI reconnects its socket, the first message you type carries a reconnect marker (`__controlUiReconnectResume`). Three Gateway checks still read that marker as "this is not fresh input":

1. **Skill authoring:** that one message gets no skill-library grant. If you ask the agent to save or update a skill, `skill_library` answers "Skill authoring needs a fresh message from the person requesting the change." The messages before and after it work.
2. **Pending questions:** while the agent waits on a multi-part, secret or `required_action` question, a steer message normally replaces that question. The first steer after a reconnect does not, so the run stays blocked on the question.
3. **Goal start:** a goal start with the marker is rejected. The Control UI never sends the marker with a goal start, so this refusal cannot be reached.

This is the same class as openclaw#204669 (the cron creator admission). Each send is admitted on its own when it starts. The marker must not change what new input can do.

## User Impact

The first message after a reconnect can save or update skills and can replace a pending question, the same as any other message.

## Why This Change Was Made

The three reads are deleted. No new code. Production lines: +2/−5.

Replay dedupe does not depend on the marker: a repeated `idempotencyKey` is answered from the chat-send dedupe cache (`chat-send-pre-admission.ts`).

Kept on purpose: the marker still reaches `chat-user-turn-recorder.ts` → `resumeRequestedSession`, which skips idle/daily session rollover when the reconnecting tab sends the session's current `sessionId` (openclaw#89017, "sessions persist after reconnects"). That is a session-lifecycle choice, not admission: it does not change tools, questions, goals or skills. So the marker itself stays.

Accepted edge case: an outbox message typed before a question appeared, and first sent after a reconnect, now also replaces that question, like any other steer.

## Evidence

- **Real Gateway, real model (gpt-5.5), head `66301b8523`:** an admin Control UI client asks the agent to call `skill_library list` on turn A (fresh), turn B (after a socket reconnect, with `__controlUiReconnectResume: true` and the same `sessionId`) and turn C (fresh). All three tool results list the library. On main `455100f26b1b`, turn B returned `{"status":"error","error":"Skill authoring needs a fresh message from the person requesting the change."}`. The check now reads the tool result, not the model's reply.
- **Red on base, green on head:**
  - `chat-send-session-binding.test.ts` › "grants skill authoring to the first message typed after a Control UI reconnect": a direct Control UI admin `chat.send` with the marker and the session's `sessionId` gets `skillLibraryAuthoring`. On merge base `ab61848f5bfc`: `expected undefined to be defined`.
  - `chat-send-question-replacement.test.ts` › `reconnect-resume` row: a reconnect-resumed steer replaces a pending multi-part question. On merge base: `expected false to be true`.
- Pre-push: 11 test files (touched tests and direct importers of the changed sources), 206 tests, all pass. `pnpm tsgo:core`, `pnpm tsgo:test`, oxfmt and oxlint on the changed files: clean.
- One-admission E2E (Q/R/S) and local review results: see comments.

Co-authored-by: Ayaan Zaidi <[email protected]>
tideclaw-bot pushed a commit that referenced this pull request Nov 30, 2026
… and answer pending questions (#204698)

Related: #167867, #204669

After the Control UI reconnects its socket, the first message you type carries a reconnect marker (`__controlUiReconnectResume`). Three Gateway checks still read that marker as "this is not fresh input":

1. **Skill authoring:** that one message gets no skill-library grant. If you ask the agent to save or update a skill, `skill_library` answers "Skill authoring needs a fresh message from the person requesting the change." The messages before and after it work.
2. **Pending questions:** while the agent waits on a multi-part, secret or `required_action` question, a steer message normally replaces that question. The first steer after a reconnect does not, so the run stays blocked on the question.
3. **Goal start:** a goal start with the marker is rejected. The Control UI never sends the marker with a goal start, so this refusal cannot be reached.

This is the same class as #204669 (the cron creator admission). Each send is admitted on its own when it starts. The marker must not change what new input can do.

The first message after a reconnect can save or update skills and can replace a pending question, the same as any other message.

The three reads are deleted. No new code. Production lines: +2/−5.

Replay dedupe does not depend on the marker: a repeated `idempotencyKey` is answered from the chat-send dedupe cache (`chat-send-pre-admission.ts`).

Kept on purpose: the marker still reaches `chat-user-turn-recorder.ts` → `resumeRequestedSession`, which skips idle/daily session rollover when the reconnecting tab sends the session's current `sessionId` (#89017, "sessions persist after reconnects"). That is a session-lifecycle choice, not admission: it does not change tools, questions, goals or skills. So the marker itself stays.

Accepted edge case: an outbox message typed before a question appeared, and first sent after a reconnect, now also replaces that question, like any other steer.

- **Real Gateway, real model (gpt-5.5), head `66301b8523`:** an admin Control UI client asks the agent to call `skill_library list` on turn A (fresh), turn B (after a socket reconnect, with `__controlUiReconnectResume: true` and the same `sessionId`) and turn C (fresh). All three tool results list the library. On main `4164dcb200af`, turn B returned `{"status":"error","error":"Skill authoring needs a fresh message from the person requesting the change."}`. The check now reads the tool result, not the model's reply.
- **Red on base, green on head:**
  - `chat-send-session-binding.test.ts` › "grants skill authoring to the first message typed after a Control UI reconnect": a direct Control UI admin `chat.send` with the marker and the session's `sessionId` gets `skillLibraryAuthoring`. On merge base `500e19e4490b`: `expected undefined to be defined`.
  - `chat-send-question-replacement.test.ts` › `reconnect-resume` row: a reconnect-resumed steer replaces a pending multi-part question. On merge base: `expected false to be true`.
- Pre-push: 11 test files (touched tests and direct importers of the changed sources), 206 tests, all pass. `pnpm tsgo:core`, `pnpm tsgo:test`, oxfmt and oxlint on the changed files: clean.
- One-admission E2E (Q/R/S) and local review results: see comments.

Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit 15b7df3)

Companion audit: da88cb8 selected immediately next for the same fixture cleanup. 1ef0005 is a separate later lane pick; 283b6d7, 50a7368, 5e3065e and 63e0742 introduce unrelated sharing, snooze or authority-owner changes.

Release adaptation: Apply only skillLibrary.isHumanTurn and its directly admitted stable reconnect regression; omit the absent question replacement owner and unrelated goal change.

Co-authored-by: RomneyDa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: S 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.

1 participant