GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — refactor(core)!: call the session tools opencode.session.rename and .move in Code Mode by rekram1-node · Pull Request #65080 · anomalyco/opencode

refactor(core)!: call the session tools opencode.session.rename and .move in Code Mode #65080

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
rekram1-node merged 2 commits into dev from tool-namespaces
Nov 20, 2026

Uh oh!

There was an error while loading. Please reload this page.

Merged

refactor(core)!: call the session tools opencode.session.rename and .move in Code Mode #65080

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
2 commits
Select commit Hold shift + click to select a range
7a2d559
refactor(core)!: call the session tools opencode.session.rename and .…
rekram1-node Nov 20, 2026
ad090d8
test(core): deny a nested-namespace tool by its flattened name
rekram1-node Nov 20, 2026
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view

There are no files selected for viewing

4 changes: 2 additions & 2 deletions 4 packages/core/src/automation/code.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ const FORBIDDEN_TOOLS = new Set([
"opencode.automation_pause",
"opencode.automation_resume",
"opencode.automation_delete",
"opencode.session_move",
"opencode.session_rename",
"opencode.session.move",
"opencode.session.rename",
"opencode.worktree_create",
"opencode.worktree_remove",
])
Expand Down
10 changes: 5 additions & 5 deletions 10 packages/core/src/tool/plugin/opencode.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const Plugin = {
Effect.sync(() => {
const text =
"execute" in event.tools
? "When you create a worktree outside the current working directory and intend to use it as your primary working directory, consider using `execute` to call `tools.opencode.session_move` and make the worktree the session's working directory."
? "When you create a worktree outside the current working directory and intend to use it as your primary working directory, consider using `execute` to call `tools.opencode.session.move` and make the worktree the session's working directory."
: "opencode_session_move" in event.tools
? "When you create a worktree outside the current working directory and intend to use it as your primary working directory, consider calling `opencode_session_move` to make the worktree the session's working directory."
: undefined
Expand All @@ -120,12 +120,12 @@ export const Plugin = {
"Tools for managing OpenCode itself, such as working with sessions and worktrees, searching the available models, and reading MCP resources.",
})
draft.add({
name: "session_rename",
name: "rename",
description:
"Rename a session, or omit sessionID to rename the current session. Use a short, specific title that summarizes the work being done.",
input: RenameInput,
output: RenameOutput,
options: { namespace: "opencode", codemode: true },
options: { namespace: "opencode.session", codemode: true },
execute: (input, context) => {
const sessionID = input.sessionID ?? context.sessionID
const title = input.title.trim()
Expand All @@ -140,12 +140,12 @@ export const Plugin = {
},
})
draft.add({
name: "session_move",
name: "move",
description:
"Move a session to another directory, or omit sessionID to move the current session. The current session moves at the next safe boundary; do not run destination-dependent tools in the same execute call.",
input: MoveInput,
output: MoveOutput,
options: { namespace: "opencode", codemode: { pinned: true } },
options: { namespace: "opencode.session", codemode: { pinned: true } },
execute: (input, context) =>
Effect.gen(function* () {
const sessionID = input.sessionID ?? context.sessionID
Expand Down
2 changes: 1 addition & 1 deletion 2 packages/core/test/tool-opencode.test.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ it.effect("adapts the worktree session_move hint to execute, direct tools, or ne
.pipe(Effect.map((event) => event.system.map((part) => part.text)))

expect(yield* trigger({ execute: { description: "execute", input: {} } })).toEqual([
"When you create a worktree outside the current working directory and intend to use it as your primary working directory, consider using `execute` to call `tools.opencode.session_move` and make the worktree the session's working directory.",
"When you create a worktree outside the current working directory and intend to use it as your primary working directory, consider using `execute` to call `tools.opencode.session.move` and make the worktree the session's working directory.",
])
expect(yield* trigger({ opencode_session_move: { description: "move", input: {} } })).toEqual([
"When you create a worktree outside the current working directory and intend to use it as your primary working directory, consider calling `opencode_session_move` to make the worktree the session's working directory.",
Expand Down
16 changes: 16 additions & 0 deletions 16 packages/core/test/tool-registry.test.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -1008,6 +1008,22 @@ describe("Tool", () => {
}),
)

it.effect("denies a nested-namespace tool by its flattened name in Code Mode and as a direct tool", () =>
Effect.gen(function* () {
const service = yield* Tool.Service
yield* transform(service, { move: make(), rename: make() }, { namespace: "opencode.session" })
const deny: Permission.Ruleset = [{ action: "opencode_session_move", resource: "*", effect: "deny" }]

const codeMode = yield* service.snapshot(deny)
const paths = codeModeListings(codeMode.codeModeCatalog!).map((entry) => entry.path)
expect(paths).toContain("opencode.session.rename")
expect(paths).not.toContain("opencode.session.move")

const direct = yield* service.snapshot([...deny, { action: "execute", resource: "*", effect: "deny" }])
expect(direct.definitions.map((tool) => tool.name)).toEqual(["opencode_session_rename"])
}),
)

it.effect("filters disabled tools with edit aliases and ordered wildcard precedence", () =>
Effect.gen(function* () {
const service = yield* Tool.Service
Expand Down
9 changes: 5 additions & 4 deletions 9 services/site/src/docs/content/tools.mdx
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,12 @@ tools enforce the permissions they assert.

### Sessions

The `opencode` Code Mode namespace contains session utilities:
The `opencode.session` Code Mode namespace contains session utilities. Without Code
Mode they are listed as `opencode_session_rename` and `opencode_session_move`.

- `session_rename` changes the title of the current session, or another session
- `rename` changes the title of the current session, or another session
selected by `sessionID`.
- `session_move` moves the current session, or another selected session, to a
- `move` moves the current session, or another selected session, to a
relative or absolute `directory`. The move takes effect at a safe boundary,
so destination-dependent work belongs in a later call.

Expand All @@ -260,7 +261,7 @@ Rename this session to "Timeout cleanup", then move it to the new worktree.

### Worktrees

The same namespace manages worktrees for the session's project:
The `opencode` namespace manages worktrees for the session's project:

- `worktree_create` creates a worktree from a `name` and returns its
`directory`. The project's worktree configuration selects the destination and
Expand Down
Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.