feat(cli): manage workspace control by label slug - #706
Merged
Merged
Conversation
- treat the workspace's URL label slug (ws- prefix stripped from legacy labels) as the user-facing id - resolve slugs to numeric ids by scanning the paged list on get/attach/suspend/resume/access/delete - accept slug, full legacy label, or numeric id; numeric ids never trigger a scan - drop the LABEL column from the list table and key rows by the slug id - apply the same mapping on the cli and mcp surfaces via the shared workspaces deps wiring
This comment has been minimized.
This comment has been minimized.
Code Coverage ReportTotal Coverage: 55.3% Generated from commit: c87bbdc |
- resolve labels first for every id, so a purely numeric label slug is not shadowed by the numeric interpretation - treat an unmatched numeric id as the numeric form the backend expects
This comment has been minimized.
This comment has been minimized.
- resolve numeric ids as-is without paging the workspace list - document that a purely numeric label slug is ambiguous with a row id and the numeric interpretation wins
Kody Review CompleteGreat news! 🎉 Keep up the excellent work! 🚀 Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Workspace control no longer depends on the sequential numeric row ID. The user-facing workspace ID is the slug form of the workspace's opaque URL label (
ws-ugki684o→ugki684o; bare labels from portal-plugin-ipfs#1040 pass through unchanged, with a numeric fallback when a workspace has no label).A service decorator resolves the slug to the numeric ID internally by scanning the user's paged workspace list as needed, so
workspaces get/attach/suspend/resume/access/deleteaccept the slug, the full legacyws-<slug>label, or the plain numeric ID. Numeric IDs never trigger a scan, and an unresolvable slug fails before any backend call.The list table drops the LABEL column (the slug is the label), keys rows by the slug ID, and is built on the CLI side so the human view carries the user-facing identifier. Both the CLI and MCP surfaces get the same behavior, since both build their workspaces deps through the same wiring.
Summary
This pull request makes workspace slugs (the human-friendly, opaque label identifiers like
ugki684o) usable as the workspace ID across the CLI's single-workspace operations, in addition to the existing numeric IDs.Functional Changes
Label-Slug Identification
ugki684o) and the legacyws-<slug>label form (e.g.,ws-ugki684o). Both resolve to the same workspace.labelResolvingWorkspacesdecorator (workspaces_label.go) wraps the workspaces service and intercepts the single-workspace operations (get,attach,suspend,resume,access,delete). When called with a label slug, it scans the user's paged workspace list to resolve the slug to the backend's sequential numeric ID and forwards that ID to the operation.catalog_workspaces_wiring.gowas updated so both the CLI and MCP surfaces use this label-resolving wrapper.Output/Rendering Updates
get/create/attach/suspend/resume) likewise shows the label slug as the ID and drops the duplicate label line.Tests
Known Issue (from code review)
One high-severity finding was reported: fully numeric label slugs (e.g., a workspace whose slug happens to be all digits) are shadowed by the numeric-ID pass-through logic in
resolveID, making such slugs unreachable and causing them to resolve to the wrong workspace.