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(server): batch writes for experimental spaces by kommander · Pull Request #66668 · anomalyco/opencode

Conversation

@kommander

@kommander kommander commented Nov 26, 2026 •
edited by opencodejr Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Issue for this PR

None; follow-up to #63998.

Type of change

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

What does this PR do?

Replaces the experimental space PUT/DELETE /api/experimental/space/:space/:key with one POST /api/experimental/space/:space/write (experimental.space.write): { changes: [{ key, value }] }, 1–1024 changes, value: null deletes, values ≤ 1 MiB UTF-8 in total. The batch commits in one transaction under the per-space lock; each change that changes a key gets the next revision in order (a repeated key gets both, last wins) and its own updated/deleted event after commit. Returns { revision, cursor }: the head after the write. Experimental, no flag.

How did you verify your code works?

Updated and added core/server space tests (batches, ordering, events, returned cursor, limits); server suite, space tests 10x, bun run check, typecheck:tsc, check:generated.

Screenshots / recordings

N/A

Checklist

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

Added by the opencode bot (AI-generated).

Public API: replaces experimental.space.set/delete (PUT/DELETE /api/experimental/space/:space/:key) with experimental.space.write (POST /api/experimental/space/:space/write); breaking for callers of the experimental endpoints

Sorry, something went wrong.

Uh oh!

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

All reactions
@kommander
feat(server): batch writes for experimental spaces
d4fe15e
@github-actions github-actions Bot added the contributor label Nov 26, 2026
opencodejr[bot]
opencodejr Bot reviewed Nov 26, 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.

I found nothing that blocks this. I ran opencode serve from this branch and checked the endpoint with curl:

  • A mixed batch (a key set twice, a key set then deleted, an unset key deleted) left the space as expected and returned the head and its cursor.
  • A batch that changes nothing returned the current head.
  • An empty changes list was rejected.
  • The old PUT route now returns 404.

The server and core space tests and typecheck:tsc for server, core and client pass.

The transaction, the per-space lock, and sending events in revision order after the commit all hold up. Counting several tombstones toward the purge interval at once keeps the existing purge behaviour.

Public API impact. This breaks existing callers, but the endpoints are experimental and nothing else in the repo calls them:

  • Removed: PUT /api/experimental/space/:space/:key (experimental.space.set).
  • Removed: DELETE /api/experimental/space/:space/:key (experimental.space.delete).
  • Removed: the matching client methods experimental.space.set / .delete and their ExperimentalSpaceSet* / ExperimentalSpaceDelete* types.
  • Added: POST /api/experimental/space/:space/write (experimental.space.write, client experimental.space.write).
    • Body: { changes: [{ key, value: string | null }] }, 1–1024 changes.
    • Returns { revision, cursor } instead of 204.
  • Added: schema exports Space.Change and Space.MaxChanges.
  • Changed: the 1 MiB cap now applies to the total of all values in a write instead of to each single value.
  • Event types are unchanged: one experimental.space.updated / experimental.space.deleted per change that changes a key.

External callers need to move to write: { changes: [{ key, value }] } to set a key, value: null to delete one.

Sorry, something went wrong.

Uh oh!

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

All reactions
@kommander
kommander merged commit 63b7f04 into dev Nov 26, 2026
14 checks passed

Uh oh!

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

@kommander
kommander deleted the space-batch-write branch November 26, 2026 20:52
@simonklee simonklee mentioned this pull request Nov 26, 2026
fix(cli-rs): port selection colours and ACP fixes, and regenerate bindings #66652
Merged
@kommander kommander mentioned this pull request Nov 26, 2026
feat(server): sync and write several experimental spaces in one request #66694
Merged
3 of 6 tasks
@Edo771977 Edo771977 mentioned this pull request Nov 27, 2026
chore: merge upstream/dev into the fork Edo771977/opencode#102
Merged
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

contributor

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

@kommander
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.