Skip to content

fix(opencode): explain initialization errors and document remove limits - #50

Merged
nexxeln merged 2 commits into
devfrom
nxl/plugin-error-hints
Oct 5, 2026
Merged

nexxeln merged 2 commits into
devfrom
nxl/plugin-error-hints

Conversation

@nexxeln

@nexxeln nexxeln commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Stack: #49 ← #50

Why the change

A deleted .rift marker or an uninitialized parent showed up in OpenCode as raw errors like rift marker is missing: <path>, and the rift.remove tool didn't tell the agent which removals it refuses.

Special things to note

Change outline

The one hard-coded rewrite becomes a table of error code to hint.

+hints = {
+  workspace_not_initialized: "Rift source is not initialized; run `rift init` from the project root first",
+  initialization_required:   "This Rift workspace must be initialized first; run `rift init` from its root folder",
+  missing_marker:            "This Rift workspace is missing its `.rift` marker; run `rift init` to restore it",
+}
 failure(error)
-  if code is workspace_not_initialized → hint, else error.message
+  hints[error.code] ?? error.message

Docs the agent and users see:

 rift.remove description
-  Remove a Rift workspace from the current project.
+  … Refuses the workspace this session is in and workspaces that still have child workspaces.

 plugins/opencode/README.md › Limits
+  Windows can't create workspaces, because Rift needs copy-on-write cloning.

@nexxeln
nexxeln added this pull request to stack #51 October 5, 2026 07:51
@nexxeln nexxeln changed the title nxl/plugin error hints fix(opencode): explain initialization errors and document remove limits Oct 5, 2026
Base automatically changed from nxl/tool-hook-warnings to dev October 5, 2026 08:10
@nexxeln
nexxeln force-pushed the nxl/plugin-error-hints branch from cfd5548 to 8840b16 Compare October 5, 2026 08:10
@nexxeln
nexxeln merged commit 4bb4444 into dev Oct 5, 2026
9 checks passed
@nexxeln nexxeln mentioned this pull request Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant