Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions apps/daemon/internal/agent/claudesdk/commands_session_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (

func TestWorkspaceCommandsRequirePackagedFeature(t *testing.T) {
config := preparationFixture(t, "old-command-runtime")
if _, err := NewPreparationFactory(config)(t.Context(), preparationRequest()); err == nil || !strings.Contains(err.Error(), "workspace preparation is unavailable") {
if _, err := NewExecutorFactory(config)(t.Context(), preparationRequest()); err == nil || !strings.Contains(err.Error(), "workspace preparation is unavailable") {
t.Fatal("old bridge accepted command observations", err)
}
if _, err := os.Stat(filepath.Join(config.StateDir, "launched")); !os.IsNotExist(err) {
Expand All @@ -28,16 +28,16 @@ func TestWorkspaceCommandsRequirePackagedFeature(t *testing.T) {

func TestWorkspaceCommandFramesKeepStartIdentityAndObservedOutput(t *testing.T) {
config := preparationFixture(t, "commands-success")
resource, err := NewPreparationFactory(config)(t.Context(), preparationRequest())
resource, err := NewExecutorFactory(config)(t.Context(), preparationRequest())
if err != nil {
t.Fatal(err)
}
defer resource.Close()
defer resource.Close(context.Background())
if _, err := os.Stat(filepath.Join(config.StateDir, "start.json")); !os.IsNotExist(err) {
t.Fatal("preparation submitted a command")
}
out := make(chan proto.Envelope, 16)
s, err := resource.Start(t.Context(), "actual-command-run", proto.TextInput("hello"), out)
s, err := resource.StartTurn(t.Context(), "actual-command-run", proto.TextInput("hello"), out)
if err != nil {
t.Fatal(err)
}
Expand Down
5 changes: 0 additions & 5 deletions apps/daemon/internal/agent/claudesdk/contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@ var (
_ agent.WorkspaceReader = (*session)(nil)
_ agent.WorkspaceDirectoryLister = (*session)(nil)
_ agent.WorkspaceWriter = (*session)(nil)
_ agent.Prepared = (*prepared)(nil)
_ agent.PreparedCancellation = (*prepared)(nil)
_ agent.WorkspaceReader = (*executor)(nil)
_ agent.WorkspaceDirectoryLister = (*executor)(nil)
_ agent.WorkspaceWriter = (*executor)(nil)
_ agent.WorkspaceReader = (*prepared)(nil)
_ agent.WorkspaceDirectoryLister = (*prepared)(nil)
_ agent.WorkspaceWriter = (*prepared)(nil)
)
8 changes: 2 additions & 6 deletions apps/daemon/internal/agent/claudesdk/declaration.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ func discoverWithCheck(parent context.Context, options agent.DiscoveryOptions, d
}
caps := &out.Info.Capabilities
caps.EnvironmentNone, caps.FunctionTools = proto.CapabilityUnsupported, proto.CapabilityFromBool(info.SupportsWorkspaceFunctions())
caps.Preparation, caps.LocalEnvironment = proto.CapabilitySupported, proto.CapabilitySupported
caps.WorkspaceReadPreparation, caps.NativeSessionRecovery = proto.CapabilitySupported, proto.CapabilitySupported
caps.LocalEnvironment, caps.WorkspaceReadPreparation = proto.CapabilitySupported, proto.CapabilitySupported
caps.NativeSessionRecovery = proto.CapabilitySupported
}
out.Info.Available, out.Info.Version = true, info.SDK
out.Info.Capabilities.MessageImages = proto.CapabilityFromBool(info.SupportsMessageImages())
Expand All @@ -139,10 +139,6 @@ func discoverWithCheck(parent context.Context, options agent.DiscoveryOptions, d
out.Info.Capabilities.MCPHTTPRequired = proto.CapabilityUnsupported
}
out.Executor = NewExecutorFactory(config)
if out.Info.Capabilities.LocalEnvironment.IsSupported() {
out.Preparation = NewPreparationFactory(config)
out.WorkspaceReadPreparation = true
}

fmt.Fprintf(options.Stdout, "Claude SDK preflight ok (SDK %s, %s)\n", info.SDK, info.Native)
return out
Expand Down
2 changes: 1 addition & 1 deletion apps/daemon/internal/agent/claudesdk/declaration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func TestRuntimeDiscoveryConfigurationAndRegistration(t *testing.T) {
}
continue
}
if calls != 1 || runtime.Info.Available != ready || (runtime.Executor != nil) != ready || runtime.Preparation != nil {
if calls != 1 || runtime.Info.Available != ready || (runtime.Executor != nil) != ready || runtime.Info.Capabilities.WorkspaceReadPreparation.IsSupported() {
t.Fatalf("runtime: %+v", runtime)
}
registry := agent.NewRegistry()
Expand Down
116 changes: 0 additions & 116 deletions apps/daemon/internal/agent/claudesdk/preparation.go

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,6 @@ func runPreparationHelper() {
_ = json.Unmarshal(fields["turn_id"], &turnID)
emit, finish := helperTurnOutput(scanner, turnID)
defer finish()
if mode == "cancellation" {
runCancellationHelper(request, "cancellation-wait", scanner, emit)
return
}
if strings.HasPrefix(mode, "commands") {
runCommandsHelper(request, mode, scanner, emit)
return
Expand Down
Loading
Loading