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 — Add `Workspace` API and caching support by vito · Pull Request #11874 · dagger/dagger

Conversation

@vito

@vito vito commented Feb 17, 2026

Copy link
Copy Markdown
Contributor

Extracting a backwards-compatible portion of #11812 that we can ship first and begin adopting in the repo.

Sorry, something went wrong.

Uh oh!

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

All reactions
@vito
vito force-pushed the workspace-api branch 5 times, most recently from 1c1b128 to 6fa85d7 Compare February 17, 2026 21:44
@vito
vito marked this pull request as ready for review February 17, 2026 21:48
@vito
vito requested review from a team as code owners February 17, 2026 21:48
@vito
vito requested review from grouville, kpenfound, shykes, sipsma and tiborvass February 17, 2026 22:30
shykes
shykes reviewed Feb 17, 2026
View reviewed changes

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

API nits:

  • install and moduleInit are named inconsistently. Maybe moduleInstall and moduleInit, or installModule and installModule?

  • Missing Workspace.search and Workspace.findUp (so I can port all our toolchains :) But can be a follow-up

Sorry, something went wrong.

Uh oh!

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

All reactions
@vito
vito force-pushed the workspace-api branch 2 times, most recently from edb0128 to 2a9897e Compare February 18, 2026 00:04
sipsma
sipsma reviewed Feb 18, 2026
View reviewed changes
Comment thread core/workspace.go Resolved

Uh oh!

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

Comment thread dagql/cache.go Resolved

Uh oh!

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

Comment thread core/modfunc.go Resolved

Uh oh!

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

Comment thread core/schema/workspace.go Resolved

Uh oh!

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

Comment thread core/schema/workspace.go Resolved

Uh oh!

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

Comment thread core/schema/workspace.go Resolved

Uh oh!

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

Comment thread core/schema/workspace.go Resolved

Uh oh!

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

Comment thread core/schema/workspace.go Resolved

Uh oh!

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

Comment thread core/workspace/config.go Resolved

Uh oh!

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

Comment thread core/workspace/detect.go Outdated
Comment on lines +43 to +48
func Detect(
ctx context.Context,
statFS core.StatFS,
readFile func(ctx context.Context, path string) ([]byte, error),
cwd string,
) (*Workspace, error) {

@sipsma sipsma Feb 18, 2026

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.

This is another tricky thing where it might be nice to have an LLM write unit test coverage. Seems like everything is mock-able enough already potentially? (not a blocker if big headache)

Sorry, something went wrong.

Uh oh!

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

All reactions

@vito vito Feb 18, 2026

Copy link
Copy Markdown
Contributor Author

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.

Removed - saving for #11812 where it's relevant

Sorry, something went wrong.

Uh oh!

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

sipsma reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
shykes
shykes reviewed Feb 18, 2026
View reviewed changes

@shykes shykes 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 just realized we need this for blueprints too... Better to do in this PR, or as a follow-up?

Sorry, something went wrong.

Uh oh!

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

All reactions
@vito
vito force-pushed the workspace-api branch 2 times, most recently from 9724162 to b84dfee Compare February 18, 2026 16:55
shykes and others added 6 commits February 18, 2026 12:23
@shykes @claude @vito
feat: add engine-side Workspace type and schema resolvers
90d0aa2
Add a dagql Workspace type that exposes workspace detection, module
installation, and module initialization through the GraphQL schema.
This moves workspace logic into the engine so CLI commands can use
the standard dagql pipeline instead of reimplementing filesystem
operations client-side.

New resolvers:
- workspace(): detect workspace root and config from cwd
- workspace.install(): add a module to .dagger/config.toml
- workspace.moduleInit(): scaffold a new module and auto-install it

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
@vito
core: DagqlWorkspace -> Workspace
7afd078
Signed-off-by: Alex Suraci <[email protected]>
@vito
api: rename workspace() to currentWorkspace() on Query root
e11d133
Follow the naming convention of currentTypeDefs() to make it clear this
returns the detected workspace for the current session, not a general
workspace constructor.

Signed-off-by: Alex Suraci <[email protected]>
@vito
core: don't hide Workspace from SDKs
318a80e
Signed-off-by: Alex Suraci <[email protected]>
@vito
core: automatically inject Workspace args into module functions
0d7b51b
Integrate workspace arg passing from the workspace-api branch:

- Add IsWorkspace() to FunctionArg to identify Workspace-typed arguments
- Make Workspace args always optional in the GraphQL schema, since they
  are automatically injected by the engine
- In CacheConfigForCall, detect Workspace args and inject them via the
  currentWorkspace query, similar to how contextual args (defaultPath)
  are handled
- Add loadWorkspaceArg() which resolves the workspace through the
  existing currentWorkspace query
- Validate that Workspace cannot be stored as a field on module objects
  (it must be declared as a function argument)
- Add Workspace to the digest fallback list in wrapper.go

Signed-off-by: Alex Suraci <[email protected]>
@vito
api: add Workspace.directory and Workspace.file
6d8b829
Add directory() and file() methods to the Workspace type, providing
host-backed filesystem access scoped to the workspace root.

- directory(path, include, exclude) returns a Directory snapshot from
  the host, with the path resolved relative to the workspace root.
  Delegates to Host.Directory for the actual host filesystem sync.

- file(path) returns a single File from the host, resolved relative
  to the workspace root. Uses the same host directory + file extraction
  pattern as Host.file.

Both methods use CachePerClient caching since they reflect live host
filesystem state.

Signed-off-by: Alex Suraci <[email protected]>
vito added 12 commits February 18, 2026 12:23
@vito
mark currentWorkspace experimental
91564e7
Signed-off-by: Alex Suraci <[email protected]>
@vito
evals: fix another workspace reference
56db019
along the way, unignore modules/evals/ and fix lints

Signed-off-by: Alex Suraci <[email protected]>
@vito
Add Workspace.findUp API
3abbb0e
Adds a findUp field to the Workspace type that searches for a file or
directory by walking up from a given path within the workspace. The
search stops at the workspace root and will not traverse above it.

Returns the path relative to the workspace root if found, or null if
not found.

Signed-off-by: Alex Suraci <[email protected]>
@vito
Workspace: remove install and moduleInit
1a216e4
Signed-off-by: Alex Suraci <[email protected]>
@vito
regen
3a25886
Signed-off-by: Alex Suraci <[email protected]>
@vito
clarify Workspace.ConfigPath
7f319e6
Signed-off-by: Alex Suraci <[email protected]>
@vito
add ObjectResult.WithContentDigestAny
750a18a
Signed-off-by: Alex Suraci <[email protected]>
@vito
unconditionally content-hash function returns
57fea54
Signed-off-by: Alex Suraci <[email protected]>
@vito
regen
9703db3
Signed-off-by: Alex Suraci <[email protected]>
@vito
CacheAsRequested -> CachePerClient
6082e45
Signed-off-by: Alex Suraci <[email protected]>
@vito
fix FindUp test (can't store Workspace)
cd4a277
Signed-off-by: Alex Suraci <[email protected]>
@vito
use errors.As
8004762
Signed-off-by: Alex Suraci <[email protected]>
@vito
vito force-pushed the workspace-api branch from b84dfee to e9104a7 Compare February 18, 2026 17:23
vito added 2 commits February 18, 2026 12:48
@vito
add Server.SpecificClientMetadata
f29b576
Signed-off-by: Alex Suraci <[email protected]>
@vito
add + use pathutil.SandboxedRelativePath
68236bb
The workspace schema had a local resolveWorkspacePath function that
resolved user-provided paths relative to a root directory while
preventing directory traversal escapes. This had two problems:

1. It used filepath (OS-dependent) instead of path (POSIX), which
   would break on Windows clients. The engine always runs on Linux,
   but workspace roots from Windows clients arrive as forward-slash
   paths with drive prefixes (e.g. 'C:/Users/foo') since the client
   normalizes backslashes before sending. Linux's filepath.IsAbs
   doesn't recognize 'C:/...' as absolute, and filepath.Clean won't
   handle drive letters correctly.

2. It was a useful general-purpose utility buried in the workspace
   schema package with no unit tests.

Moved the logic to pathutil.SandboxedRelativePath which:
- Normalizes backslashes to forward slashes for Windows client paths
- Strips drive letters (via pathutil.GetDrive) or leading '/' so
  absolute user paths are treated as relative to the root
- Uses normalizePath (already in pathutil) for consistent handling
- Verifies the resolved path doesn't escape root via '..'

Also switched workspace.go from filepath to path (POSIX) throughout,
since all path operations run on the Linux engine against
forward-slash-normalized paths.

Added 12 unit tests covering relative paths, dot, absolute paths,
dotdot escape attempts, Windows backslashes, drive letters, and
Windows roots with drive prefixes.

Signed-off-by: Alex Suraci <[email protected]>
@vito
vito force-pushed the workspace-api branch from e9104a7 to 68236bb Compare February 18, 2026 17:50
vito and others added 5 commits February 18, 2026 13:09
@vito
rm workspace.Detect and Config
4a7f1d0
not needed for this initial first pass

Signed-off-by: Alex Suraci <[email protected]>
@vito
fmt
3ce85de
Signed-off-by: Alex Suraci <[email protected]>
@vito
regen
1d355c5
Signed-off-by: Alex Suraci <[email protected]>
@vito
Revert "unconditionally content-hash function returns"
e99910b
Seems like this broke stuff after all.

This reverts commit 57fea54.

Signed-off-by: Alex Suraci <[email protected]>
@vito
tidy
bb1d111
Signed-off-by: Alex Suraci <[email protected]>
sipsma
sipsma approved these changes Feb 18, 2026
View reviewed changes

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

LGTM once tests are passing (which is expected after the revert just pushed)

Sorry, something went wrong.

Uh oh!

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

All reactions
@vito
tests: add blueprint + workspace test
696c64f
Signed-off-by: Alex Suraci <[email protected]>
@vito
vito force-pushed the workspace-api branch from 3668183 to 696c64f Compare February 18, 2026 19:53
@vito
vito merged commit b5ea047 into dagger:main Feb 18, 2026
2 checks passed

Uh oh!

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

This was referenced Feb 19, 2026
Workspaces #11812
Closed
Dynamic filtering of context directory #11287
Closed
This was referenced Apr 1, 2026
Collections #12892
Closed
Modules v2: design and roadmap #12900
Closed
@coderabbitai coderabbitai Bot mentioned this pull request Jul 25, 2026
refactor: reorganize repository sagikazarmark/restate-examples#62
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@shykes shykes shykes left review comments
@sipsma sipsma sipsma approved these changes
@tiborvass tiborvass Awaiting requested review from tiborvass
@grouville grouville Awaiting requested review from grouville
@kpenfound kpenfound Awaiting requested review from kpenfound

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.

3 participants

@vito @shykes @sipsma
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.