Skip to content

fix(ui): carry selected session ownership through chat presentation - #133149

Merged
vincentkoc merged 2 commits into
mainfrom
fix/ui-session-presentation-ownership
Aug 30, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
fix/ui-session-presentation-ownership

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Aug 30, 2026 •

Copy link
Copy Markdown
Member

Related: #133132

What Problem This Solves

Fixes an issue where a selected global agent's model, Fast mode, transcript metadata, and task-child metadata could resolve from defaults or disappear because presentation paths re-searched raw session keys.

Why This Change Was Made

The chat pane now carries the canonical owner-validated selected session through model controls, thread rendering, and transcript projection. Task transcripts resolve their own child session against the child agent. Raw global rows additionally require configured global scope and an agent-matched roster. Catalog, read-only parent, per-sender, and new-session paths remain isolated.

User Impact

Selected global chats keep their pinned model and Fast state, archive attribution, reasoning/context metadata, and child-task metadata instead of silently falling back to another agent or defaults.

Evidence

  • Model/Fast, transcript attribution, and child-session ownership regressions reproduced before the fix.
  • Raw-global scope regression failed before the fix; all 6 task-detail cases pass after it.
  • Focused presentation suites: 421/421 passing before the final scope regression was added.
  • pnpm tsgo:ui, full changed-file gate, format, oxlint, stylelint, and diff checks pass.
  • Independent P0-P2 autoreview: scoped-clean.
  • Mechanical current-main rebase preserved the exact patch ID.
  • Production LOC: +41/-41 (net 0). Tests/support: +239/-28.

Visual Proof

An isolated mock-Gateway browser run selected Work with a Work-owned raw global row and verified:

  • Agent default model: openai/gpt-default.
  • Selected session model shown as Session GPT / openai/gpt-session.
  • Fast mode visibly active.
  • Task child requested agent:work:task-child.
  • Child archive attribution visible; parent attribution absent.

Command: node --import tsx .artifacts/control-ui-e2e/selected-session-presentation/capture.mts

Capture: four 1440x900 screenshots plus 2.68s model/Fast and 2.44s task-child videos. The artifacts contain only synthetic data. Browser attachment is unavailable in this session, so the sanitized captures are retained locally and identified by SHA-256:

  • Work session: a071d53320f09e3ec96e316aa48fa2ba63790e62a66fd7f39d3eaa7179d9317c
  • Session model: 2a34eb1577c8d6fd79565cd2c353b5567b48e35cfc71589b6ecf98bc6eb944e9
  • Fast active: d05bfd6c75c7931c35a8eaac94bd58abfbd64c9ff257f24cbf1a3a86dc4c99ed
  • Child archive: 21d8db7ebaf05c255412855cc00a7c89b98519482877f8f2a6a1d8a4ae5559ba
  • Model/Fast video: 35997ed4dbcd650590f533c8f28eb3a7559ae95bcdff90b0301b1d882002adf1
  • Task-child video: 9209f4a85db15bd0f2bacde0b71bada381526d91c697f4c5fb0b50cfcb67086c

@vincentkoc vincentkoc self-assigned this Aug 30, 2026
@clawsweeper

clawsweeper Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: M maintainer Maintainer-authored PR labels Aug 30, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 30, 2026
@clawsweeper

clawsweeper Bot commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 30, 2026, 4:34 AM ET / 08:34 UTC.

ClawSweeper review

What this changes

The PR passes the owner-validated selected session through Control UI model controls, transcripts, and task-child presentation so selected global chats retain their own metadata.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep open for maintainer review: this remains a distinct presentation repair alongside the related issue and current-main collaboration fix, with no concrete introduced regression found.

Priority: P1
Reviewed head: e1120f0aa8319f9938e79ddf8e8dddf0514d2da5
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, net-neutral owner-flow repair with meaningful regression coverage and no supported correctness finding.
Proof confidence 🌊 off-meta tidepool Not applicable: This MEMBER-authored PR is exempt from the external-contributor proof gate; its body describes a synthetic mock-Gateway browser capture, but the locally retained artifact hashes were not independently viewable in this review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This MEMBER-authored PR is exempt from the external-contributor proof gate; its body describes a synthetic mock-Gateway browser capture, but the locally retained artifact hashes were not independently viewable in this review.
Evidence reviewed 6 items Canonical owner boundary: The existing selected-session resolver chooses the matching row and rejects raw global rows when the roster belongs to a different agent; the PR reuses this value instead of rediscovering it downstream.
Model and Fast presentation: The introduced model-state API accepts the canonical active session, and the control passes it to both model and Fast-mode resolution.
Task-child ownership guard: The introduced task transcript lookup permits a raw global row only for configured global scope and the matching task agent, then resolves it against the child session key.
Findings None None.
Security None None.

How this fits together

The Control UI turns a selected chat route and gateway session roster into model controls, transcript metadata, and task details. The selected session row carries the ownership facts these views need to present the correct agent state.

flowchart LR
  A[Selected chat route] --> B[Session ownership resolver]
  B --> C[Selected session row]
  C --> D[Model and Fast controls]
  C --> E[Chat transcript]
  C --> F[Task child transcript]
  D --> G[Presented agent state]
  E --> G
  F --> G
Loading

Decision needed

Question Recommendation
After exact-head CI completes, should this selected-session presentation repair be accepted as the companion to the current-main collaboration-state repair? Accept the focused companion repair: Approve this PR once exact-head CI confirms the model, transcript, and task-child paths compose with current main.

Why: The PR is member-authored and carries the protected maintainer label; the remaining decision is whether the scoped presentation split is acceptable for the selected-session ownership invariant.

Before merge

  • Resolve merge risk (P1) - The supplied test-merge artifact has stale parents; although GitHub reports a clean merge, exact-head CI should validate the combined result with current main's related collaboration-state repair before landing.
  • Complete next step (P2) - No mechanical repair is identified; exact-head CI and the protected maintainer review remain before merge.
Agent review details

Security

None.

PR surface

Source +1, Tests +210. Total +211 across 17 files.

View PR surface stats
Area Files Added Removed Net
Source 13 44 43 +1
Tests 4 236 26 +210
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 17 280 69 +211

Review metrics

Metric Value Why it matters
Production versus test delta production +41/-41 (net 0); tests/support +239/-28 The bug repair replaces downstream session rediscovery without increasing production code overall, while adding focused ownership regression coverage.

Mantis proof suggestion

A web UI chat check could directly verify that a selected global session retains its own model, Fast mode, and archive presentation. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis verify selected-global web UI chat presentation keeps the selected agent’s model, Fast state, and archive attribution, and return redacted evidence.

Merge-risk options

Maintainer options:

  1. Validate the combined session flow (recommended)
    Let exact-head CI validate this presentation patch together with current main's collaboration-state repair before merging.
  2. Pause for consolidation
    Keep the PR open if maintainers decide the related ownership tracks need one coordinated change instead of complementary PRs.

Technical review

Best possible solution:

Retain one canonical owner-validated selected-session flow for presentation, and land this focused companion repair after exact-head validation.

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

Yes, source-reproducible: the focused model and task-detail tests construct the raw-global ownership cases, though this read-only review did not execute them.

Is this the best way to solve the issue?

Yes: passing the already owner-validated selected row is preferable to repeating raw session-key matching in each presentation consumer.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 8423dcd6a17d.

Labels

Label justifications:

  • P1: The change addresses silent incorrect session-state presentation for selected global chats.
  • merge-risk: 🚨 session-state: The PR changes which agent-owned session row controls displayed model, Fast mode, and archive metadata.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This MEMBER-authored PR is exempt from the external-contributor proof gate; its body describes a synthetic mock-Gateway browser capture, but the locally retained artifact hashes were not independently viewable in this review.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Allow exact-head CI to validate the clean three-way result with current main.

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 (3 earlier review cycles)
  • reviewed 2026-08-30T07:14:51.098Z sha 9050e12 :: found issues before merge. :: [P1] Gate raw global child rows on configured global scope
  • reviewed 2026-08-30T07:31:06.261Z sha 9050e12 :: found issues before merge. :: [P1] Gate raw global child rows on configured global scope
  • reviewed 2026-08-30T08:18:10.481Z sha e1120f0 :: needs maintainer review before merge. :: none

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added 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: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 30, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review August 30, 2026 08:28
@vincentkoc
vincentkoc merged commit eb7ab40 into main Aug 30, 2026
213 checks passed
@vincentkoc
vincentkoc deleted the fix/ui-session-presentation-ownership branch August 30, 2026 08:49
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 31, 2026
…penclaw#133149)

* fix(ui): carry selected session ownership through chat presentation

* fix(ui): gate task global metadata by scope
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 maintainer Maintainer-authored PR merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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