Skip to content

fix(workspaces): keep a workspace with a reserved slug editable - #179

Open
sercada wants to merge 1 commit into
openclaw:mainfrom
sercada:reserved-slug-update
Open

fix(workspaces): keep a workspace with a reserved slug editable#179
sercada wants to merge 1 commit into
openclaw:mainfrom
sercada:reserved-slug-update

Conversation

@sercada

@sercada sercada commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

The workspace that Cloudflare Access provisioning creates owns the reserved slug clickclack. Its Overview settings form submits the current slug together with the name, and normalizeWorkspaceSettings (sqlite and postgres stores) rejected any reserved slug regardless of whether it changed. Result: that workspace can never be renamed or given an icon from the UI — every save fails with workspace slug is reserved, even when only the name changed.

Why This Change Was Made

Reject a reserved slug only when it differs from the workspace's current slug. Moving a workspace to a reserved slug, or a regular workspace trying to take one, stays rejected exactly as before. Same change in both store implementations.

User Impact

Owners of the Access-provisioned default workspace can rename it and set its icon. No other behaviour changes.

Evidence

  • New TestUpdateWorkspaceKeepsReservedSlugEditable (sqlite): rename with the unchanged reserved slug succeeds; moving to guests is rejected; a regular workspace cannot take clickclack.
  • go test ./apps/api/internal/store/sqlite/ ./apps/api/internal/httpapi/: ok. go build ./..., go vet, gofmt -l clean.
  • Reproduced on a v0.3.1 deployment before the fix (the form error in the screenshot text: workspace slug is reserved).

The Access-provisioned default workspace owns the reserved slug
"clickclack". Its settings form submits the current slug together with the
name, and normalizeWorkspaceSettings rejected any reserved slug regardless
of whether it changed, so the workspace could never be renamed or given an
icon ("workspace slug is reserved"). Reject a reserved slug only when it
differs from the workspace's current slug; moving to a reserved slug, or
taking one from a regular workspace, stays rejected.
@sercada
sercada requested a review from a team as a code owner August 27, 2026 23:44
@clawsweeper

clawsweeper Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@sercada

sercada commented Aug 27, 2026

Copy link
Copy Markdown
Contributor Author

Evidence note: go test ./apps/api/internal/store/sqlite/ is green with the new test. In ./apps/api/internal/httpapi, TestHTTPErrorPathsAndSPA fails intermittently on my machine with event callback signature mismatch — also on a clean origin/main checkout (1 failure in 6 runs, -run TestHTTPErrorPathsAndSPA -count=6), so it is unrelated to this change (which touches no HTTP code). It looks like a late/retried event delivery racing the subscription-secret rotation in that test; happy to open a separate issue or fix if useful.

@clawsweeper

clawsweeper Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 29, 2026, 2:05 AM ET / 06:05 UTC.

ClawSweeper review

What this changes

The PR permits an Access-provisioned workspace to retain its existing reserved slug during a profile update and adds SQLite regression coverage.

Regression provenance

Possible regression — probable (reviewed change; reproduction). No predecessor PR is attributed.

Merge readiness

Blocked until real behavior proof is added - 4 items remain

The patch correctly fixes the current default-branch validation failure in both stores, but it still needs inspectable after-fix behavior proof before merge; one copied code comment also overstates the affected icon-upload path.

Priority: P2
Reviewed head: 75d4f7018b99a73a4f13178491347e6f3b8a1046

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The implementation is a focused, plausible repair with a minor misleading comment, but it lacks the required real after-fix behavior proof.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The changed production owners are the SQLite and PostgreSQL workspace validators, reached by the settings page’s profile-save request; the PR supplies source-level coverage and a pre-fix claim but no inspectable after-fix run showing a provisioned clickclack workspace update succeeds. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The changed production owners are the SQLite and PostgreSQL workspace validators, reached by the settings page’s profile-save request; the PR supplies source-level coverage and a pre-fix claim but no inspectable after-fix run showing a provisioned clickclack workspace update succeeds. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 7 items Current default branch still has the defect: The fetched default branch rejects every supplied reserved slug, including an unchanged current slug, in both store implementations.
UI path supplies the unchanged slug for profile saves: The settings page posts both name and slug on a profile save, so a provisioned workspace with slug clickclack reaches the rejecting validation on current main.
Provisioning owns the reserved slug: Both stores create or locate the default workspace under the clickclack slug, establishing the affected workspace boundary.
Findings 1 actionable finding [P3] Limit the comment to profile updates
Security None None.

How this fits together

Workspace profile updates flow from the settings page through the workspace API into SQLite or PostgreSQL validation before storage. The supplied slug controls whether the metadata update proceeds or returns a validation error.

flowchart LR
A[Workspace settings page] --> B[Workspace update API]
B --> C[SQLite or PostgreSQL store]
C --> D[Normalize supplied slug]
D --> E{Does slug change?}
E -->|No| F[Keep existing reserved slug]
E -->|Yes, reserved| G[Return validation error]
F --> H[Persist workspace metadata]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The changed production owners are the SQLite and PostgreSQL workspace validators, reached by the settings page’s profile-save request; the PR supplies source-level coverage and a pre-fix claim but no inspectable after-fix run showing a provisioned clickclack workspace update succeeds. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Limit the comment to profile updates (P3) - The profile save submits the slug, but the icon-only upload sends only icon_url unless the user also changed the slug. The new comment therefore incorrectly says an unchanged reserved slug blocks every icon update; correct the mirrored comments so future maintainers understand the actual affected path.
  • Resolve merge risk (P1) - There is no inspectable after-fix proof from a real provisioned workspace, so the UI/API result and deployed configuration path remain unverified before merge.
  • Complete next step (P2) - The remaining merge gate is contributor-supplied real behavior proof, which an automated repair lane cannot establish.

Findings

  • [P3] Limit the comment to profile updates — apps/api/internal/store/sqlite/sqlite.go:1235-1237
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production versus test delta production +8/-2, tests +39 The runtime change is limited to matching SQLite and PostgreSQL validation while the added regression test covers the SQLite path.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Land the mirrored validation change after a redacted real workspace-profile update demonstrates that retaining clickclack succeeds while reserved destination changes remain rejected.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Land the mirrored validation change after a redacted real workspace-profile update demonstrates that retaining clickclack succeeds while reserved destination changes remain rejected.

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

Yes, from source: the current settings page submits the unchanged slug during a profile save and current main rejects it in both stores; the default provisioner creates the clickclack workspace.

Is this the best way to solve the issue?

Yes, the normalized-slug equality check is the narrowest repair: it preserves rejection of attempts to move into a reserved slug while restoring updates for the workspace that already owns one.

Full review comments:

  • [P3] Limit the comment to profile updates — apps/api/internal/store/sqlite/sqlite.go:1235-1237
    The profile save submits the slug, but the icon-only upload sends only icon_url unless the user also changed the slug. The new comment therefore incorrectly says an unchanged reserved slug blocks every icon update; correct the mirrored comments so future maintainers understand the actual affected path.
    Confidence: 0.99

Overall correctness: patch is correct
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 486fd23545af.

Labels

Label justifications:

  • P2: This is a bounded fix for provisioned workspace profile updates, with no evidence of broader availability or security impact.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The changed production owners are the SQLite and PostgreSQL workspace validators, reached by the settings page’s profile-save request; the PR supplies source-level coverage and a pre-fix claim but no inspectable after-fix run showing a provisioned clickclack workspace update succeeds. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Recent history shows extensive work on both workspace store implementations, including the current-main authorization change affecting these paths. (role: recent shared-store contributor; confidence: medium; commits: 2fa14018d897; files: apps/api/internal/store/sqlite/sqlite.go, apps/api/internal/store/postgres/postgres.go)
  • Sergio Cadavid: History for both store implementations includes prior merged workspace-store contributions in addition to this proposed change. (role: prior store contributor; confidence: medium; commits: 5d8ff19efa94, 941c65902546; files: apps/api/internal/store/sqlite/sqlite.go, apps/api/internal/store/postgres/postgres.go)

Rank-up moves

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

  • Post a redacted after-fix settings screenshot, recording, or API/log transcript showing the provisioned workspace rename succeeds; redact private endpoints, IDs, and credentials, then update the PR body for automatic re-review or ask a maintainer to comment @clawsweeper re-review.
  • Correct the mirrored comments to describe profile saves rather than every icon update.

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 (2 earlier review cycles)
  • reviewed 2026-08-27T23:46:46.133Z sha 75d4f70 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-28T00:28:05.910Z sha 75d4f70 :: needs real behavior proof before merge. :: [P3] Correct the affected icon-update path in the comment

@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. 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 Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant