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 — feat(automation): give scheduled code the session's Code Mode tools by rekram1-node · Pull Request #65236 · anomalyco/opencode

Conversation

@rekram1-node

@rekram1-node rekram1-node commented Nov 20, 2026

Copy link
Copy Markdown
Member

Issue for this PR

No linked issue.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

I gave scheduled code the same Code Mode extensions as a session. fetch is available with either flag setting. With full_codemode on, scripts also get path, Bun, and Code Mode tools like tools.read and tools.shell.

tools.shell goes through the existing one-time approval at creation. That approval covers the tool, and each run still checks the current deny rules. I removed the tool-call cap and kept the 30-second timeout and 32 KB output cap.

How did you verify your code works?

I tested a scheduled fetch against a loopback HTTP server and ran a scheduled script that reads a fixture with Bun and calls shell after one approval. The focused automation, Code Mode, and tool tests had 151 passing tests. Core and schema typechecks and bun run check passed.

Screenshots / recordings

No UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Sorry, something went wrong.

Uh oh!

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

All reactions
opencodejr[bot]
opencodejr Bot reviewed Nov 20, 2026
View reviewed changes

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scheduled fetch, Bun/path and tools.shell work as described. I ran the new tests, the automation and Code Mode suites (125 passing) and core's tsc (passes), and probed the webfetch permission: details in the verification notes.

Public API: only the model-facing description of CodeActionInput.code changes (schema and openapi.json). Backwards compatible.

Concerns:

  • Creation approval misses the new globals. authorize only asks about the tools.* calls that scan finds. fetch (webfetch) and the Bun file APIs (read/edit/external_directory) are never asked about at creation. So when one of those permissions is ask, the automation is created without any prompt, and its first run pauses with "Permission webfetch needs approval, and nobody is present to give it". I reproduced this by setting webfetch: "ask" in the new fetch test.
  • Shell grant plus fetch. Taking shell out of FORBIDDEN_TOOLS was a deliberate choice, but the old reason still holds, and with fetch now available it matters more (inline).
  • Schema text. The schema description no longer mentions the 30s timeout, which still applies (inline).

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread packages/core/src/automation/code.ts Resolved

Uh oh!

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

Comment thread packages/core/src/automation/code.ts Resolved

Uh oh!

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

Comment thread packages/schema/src/automation.ts Resolved

Uh oh!

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

opencodejr[bot]
opencodejr Bot reviewed Nov 20, 2026
View reviewed changes

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creation now asks for webfetch when the code uses fetch, and for the Bun permissions when it uses Bun, so runs no longer pause on a permission nobody approved. I checked this with the updated fetch test (webfetch: "ask", one approval at creation, then the run fetches) and a probe of a Bun-only program. The core automation and Code Mode suites and all of packages/codemode pass (61 and 322 tests).

The shell grant and the missing 30s timeout in the schema description are still open in their threads.

One new concern: any use of Bun now asks for blanket edit and external_directory access, even for a program that only reads a file (inline).

Public API: this commit adds the scanProgram export to @opencode/codemode and changes nothing else; backwards compatible.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread packages/core/src/automation/code.ts Resolved

Uh oh!

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

@rekram1-node
rekram1-node force-pushed the automation-code-runtime branch from 27d5ca1 to fb2a34b Compare November 20, 2026 18:55
opencodejr[bot]
opencodejr Bot reviewed Nov 20, 2026
View reviewed changes

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new commit narrows what Bun asks for at creation: a read through Bun.file asks for read and external_directory, and edit only when the file is used for more than reading or through Bun.write. But it stopped asking for glob. A script using new Bun.Glob(...).scan() is now created without a glob prompt, and its first run pauses with "Permission glob needs approval". I confirmed this with a probe in the core tests (inline).

The unattended shell grant (thread 2) is still open.

Tests: core automation-shell, automation, codemode and tool-automation suites (63) and packages/codemode (322) pass; core typecheck:tsc passes. Public API unchanged by this commit.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread packages/core/src/automation/code.ts Resolved

Uh oh!

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

opencodejr[bot]
opencodejr Bot reviewed Nov 20, 2026
View reviewed changes

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thread 5 isn't fixed: Bun.Glob now asks for read and external_directory, but the scan itself checks glob, which creation still never requests. The new test shows it: with glob: "ask", the script is approved at creation and its first run pauses with "Permission glob needs approval". The test expects that pause, so it passes even though the script can't work (inline). The fallback for a bare Bun reference or an import from "bun" also still leaves out glob. Thread 2 is unchanged.

Tests: automation-shell.test.ts and automation.test.ts pass (52). Public API unchanged.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread packages/core/src/automation/code.ts Resolved

Uh oh!

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

Comment thread packages/core/test/automation-shell.test.ts Resolved

Uh oh!

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

@rekram1-node
rekram1-node force-pushed the automation-code-runtime branch from 272cffb to a82feb8 Compare November 20, 2026 19:17
opencodejr[bot]
opencodejr Bot reviewed Nov 20, 2026
View reviewed changes

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Bun.Glob gap is closed. After the rebase onto #65255, glob scans ask for read (and external_directory outside the project), which matches what creation now requests. The updated test checks that an approved scan fires and returns ["fixture.txt"]. automation-shell.test.ts, automation.test.ts and tool-execute.test.ts pass (89). Public API unchanged by this commit. Nothing new to flag.

Sorry, something went wrong.

Uh oh!

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

All reactions
rekram1-node added 6 commits November 20, 2026 14:49
@rekram1-node
feat(automation): give scheduled code the session's Code Mode tools
935e6f3
@rekram1-node
fix(automation): ask at creation for what fetch and Bun need
7b6c516
@rekram1-node
fix(automation): ask only for the Bun access a script uses
0143218
@rekram1-node
fix(automation): ask read access for Bun.Glob
29c48b1
@rekram1-node
test(automation): expect approved Bun.Glob scans to run
2b4854c
@rekram1-node
refactor(automation): simplify scheduled code capabilities and tests
c6a313b
@rekram1-node
rekram1-node force-pushed the automation-code-runtime branch from 96c21d5 to c6a313b Compare November 20, 2026 20:50
opencodejr[bot]
opencodejr Bot reviewed Nov 20, 2026
View reviewed changes

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The refactor keeps the same behaviour as far as I can tell. I ran the new scan on eight sample Bun scripts: direct and variable Bun.file reads, slice forwarding, a write through a closure that runs before the declaration, a file object passed to another function, and a Bun alias. Each asks for the same access as before. The direct codeModeTools lookup matches the registry ids from effectiveName. Core automation, tool and Code Mode tests (100) and packages/codemode (322) pass; core typecheck:tsc passes. Public API: scanProgram in @opencode/codemode gains an optional forwardingMembers argument (backwards compatible). Nothing new to flag.

Sorry, something went wrong.

Uh oh!

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

All reactions
@rekram1-node
rekram1-node enabled auto-merge (squash) November 20, 2026 21:00
@rekram1-node
rekram1-node merged commit 1f92618 into dev Nov 20, 2026
11 checks passed

Uh oh!

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

@rekram1-node
rekram1-node deleted the automation-code-runtime branch November 20, 2026 21:01
@BrewTestBot BrewTestBot mentioned this pull request Nov 23, 2026
opencode 2.4.0 Homebrew/homebrew-core#327368
Merged
@amrkmn amrkmn mentioned this pull request Nov 23, 2026
opencode 2.4.0 amrkmn/homebrew-tap#1251
Closed
1 task
@github-actions github-actions Bot mentioned this pull request Nov 23, 2026
feat: opencode release v2.4.0 sprisa/opencode-server#95
Merged
@kobzevvv kobzevvv mentioned this pull request Nov 24, 2026
chore(upstream): порт v2.4.1 — 67 в порт, 38 на решение gpt-mem/opencode-mem#223
Open
4 tasks
@scottames-github-bot scottames-github-bot Bot mentioned this pull request Nov 27, 2026
chore(deps): update ⬆️ mise-packages scottames/dots#1181
Merged
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@opencodejr opencodejr[bot] opencodejr[bot] left review comments

Uh oh!

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

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

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

1 participant

@rekram1-node
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.