Mirror of github.com/gptscript-ai/workspace-provider (upstream archived/deprecated)
  • Go 99.7%
  • Makefile 0.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Thorsten Klein d4cbb9c838
All checks were successful
test / test (push) Successful in 5m3s
fix(revisions): leave revision state unchanged when a write fails (#28)
With revisions on, a write bumped the revision counter and saved the
old content as a revision before reading the new body, so a body that
failed part-way left the counter moved: a retry with the old
latestRevisionID got a spurious conflict and history held a duplicate.
Streaming made that the normal way for a write to fail.

A per-file in-process lock serialises WriteFile, DeleteFile and
DeleteRevision. A revisioned write now snapshots the current content
into hidden revision N, records it as pending, stores the content, and
only then commits N. A write whose body never reached EOF undoes its
snapshot; any later failure leaves the revision pending, and the next
revisioned write or DeleteRevision records it, so a same-base writer
gets a conflict. Unrevisioned writes never touch the revision store.
Revision IDs are validated, hidden revisions are not readable,
DeleteFile removes revisions 0..CurrentID+1 and keeps the index if a
delete fails, and reads take the revision before the content.

Refs basepeak-ai/bpai#1220
2026-10-02 21:54:38 +00:00
.github/workflows chore: bump go (#25) 2026-04-13 10:59:30 -04:00
pkg fix(revisions): leave revision state unchanged when a write fails (#28) 2026-10-02 21:54:38 +00:00
.gitignore chore: ignore local git worktrees 2026-10-02 19:03:28 +02:00
.golangci.yml chore: bump go (#25) 2026-04-13 10:59:30 -04:00
CLAUDE.md chore(docs): CLAUDE.md and updated readme for garage 2026-06-29 15:29:01 +02:00
go.mod fix(s3, azure): stream writes instead of buffering the body (#27) 2026-10-02 18:06:52 +00:00
go.sum fix(s3, azure): stream writes instead of buffering the body (#27) 2026-10-02 18:06:52 +00:00
LICENSE Initial commit 2024-09-05 09:48:54 -04:00
main.go chore: prep for moving to gptscript-ai org 2024-10-14 14:59:43 -04:00
Makefile chore: bump go (#25) 2026-04-13 10:59:30 -04:00
README.md chore(docs): CLAUDE.md and updated readme for garage 2026-06-29 15:29:01 +02:00
tool.gpt enhance: add ability to request current revision ID when opening a file (#15) 2025-02-22 12:00:10 -05:00

workspace-provider

There are three providers that can be used to create and manage workspaces: directory, S3, and Azure.

Directory

The directory provider provides a directory-based workspace. This provider is used by default.

S3

The S3 provider provides a S3-based workspace.

This provider supports loading the default AWS configuration. You can control this configuration using the following environment variables:

  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY
  • AWS_REGION

You must set the following environment variables:

  • WORKSPACE_PROVIDER_S3_BUCKET

Usage with S3-compatible providers (e.g. Cloudflare R2)

You can use the above referenced AWS environment variables to configure the S3 provider, setting the value of the environment variable to the corresponding value from your provider. Additionally, you should also set the WORKSPACE_PROVIDER_S3_BASE_ENDPOINT environment variable to the endpoint of your provider. For example, if you are using Cloudflare R2, you can set WORKSPACE_PROVIDER_S3_BASE_ENDPOINT to https://<ACCOUNT_ID>.r2.cloudflarestorage.com.

Some S3-compatible providers do not support virtual-hosted-style requests and require path-style addressing instead (e.g. Garage and MinIO). For these, also set WORKSPACE_PROVIDER_S3_USE_PATH_STYLE=true. Make sure AWS_REGION matches the region configured on your provider (for Garage this is the s3_region value in garage.toml, which defaults to garage).

Azure

The Azure provider provides an Azure Blob Storage-based workspace.

Setup

  1. Create an Azure Storage Account in the Azure Portal
  2. Create a container in your storage account
  3. Get the connection string from your storage account (under "Access keys")

Configuration

You must set the following environment variables:

  • WORKSPACE_PROVIDER_AZURE_CONTAINER - The name of your Azure Storage container
  • WORKSPACE_PROVIDER_AZURE_CONNECTION_STRING - The connection string for your Azure Storage account

For example:

export WORKSPACE_PROVIDER_AZURE_CONTAINER="your-container-name"
export WORKSPACE_PROVIDER_AZURE_CONNECTION_STRING="DefaultEndpointsProtocol=https;AccountName=...;AccountKey=...;EndpointSuffix=core.windows.net"