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
32 changes: 0 additions & 32 deletions apps/daemon/internal/agent/claudesdk/bridge_output.go

This file was deleted.

16 changes: 6 additions & 10 deletions apps/daemon/internal/agent/claudesdk/contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,10 @@ import "github.com/MiniMax-AI/OpenAgentCore/apps/daemon/internal/agent"
// Every public Harness implements each small contract explicitly. Unsupported
// extensions return agent.ErrUnsupportedOperation without native effects.
var (
_ agent.Executor = (*executor)(nil)
_ agent.Turn = (*session)(nil)
_ agent.Session = (*session)(nil)
_ agent.DurableSteerer = (*session)(nil)
_ agent.Steerer = (*session)(nil)
_ agent.FunctionResultSubmitter = (*session)(nil)
_ agent.WorkspaceDirectoryLister = (*session)(nil)
_ agent.WorkspaceWriter = (*session)(nil)
_ agent.WorkspaceDirectoryLister = (*executor)(nil)
_ agent.WorkspaceWriter = (*executor)(nil)
_ agent.Executor = (*executor)(nil)
_ agent.Turn = (*session)(nil)
_ agent.Session = (*session)(nil)
_ agent.DurableSteerer = (*session)(nil)
_ agent.Steerer = (*session)(nil)
_ agent.FunctionResultSubmitter = (*session)(nil)
)
2 changes: 1 addition & 1 deletion apps/daemon/internal/agent/claudesdk/declaration.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func discoverWithCheck(parent context.Context, options agent.DiscoveryOptions, d
}
caps := &out.Info.Capabilities
caps.EnvironmentNone, caps.FunctionTools = proto.CapabilityUnsupported, proto.CapabilityFromBool(info.SupportsWorkspaceFunctions())
caps.LocalEnvironment, caps.WorkspaceReadPreparation = proto.CapabilitySupported, proto.CapabilitySupported
caps.LocalEnvironment = proto.CapabilitySupported
caps.NativeSessionRecovery = proto.CapabilitySupported
}
out.Info.Available, out.Info.Version = true, info.SDK
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.Info.Capabilities.WorkspaceReadPreparation.IsSupported() {
if calls != 1 || runtime.Info.Available != ready || (runtime.Executor != nil) != ready || runtime.Info.Capabilities.LocalEnvironment.IsSupported() {
t.Fatalf("runtime: %+v", runtime)
}
registry := agent.NewRegistry()
Expand Down
10 changes: 3 additions & 7 deletions apps/daemon/internal/agent/claudesdk/executor.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package claudesdk

import (
"bufio"
"context"
"encoding/json"
"errors"
Expand Down Expand Up @@ -69,7 +70,6 @@ func startExecutor(ctx context.Context, checked *runtimeCheckCache, probe Config
if err != nil {
return nil, err
}
base.directories.supported = slices.Contains(info.Features, "workspace_directory")
e := &executor{base: base, start: start, ready: make(chan error, 1), done: make(chan struct{}), nativeID: start.Resume}
go e.read()
if err = e.write(start); err == nil {
Expand Down Expand Up @@ -136,7 +136,8 @@ func (e *executor) write(value any) error {
func (e *executor) read() {
stderrDone := make(chan struct{})
go func() { _, _ = io.Copy(io.Discard, e.base.process.Stderr); close(stderrDone) }()
scanner := e.base.bridgeOutput()
scanner := bufio.NewScanner(e.base.process.Stdout)
scanner.Buffer(make([]byte, 64*1024), 2*1024*1024)
ready := false
readyFailure := errors.New("claudesdk: Executor readiness failed")
for scanner.Scan() {
Expand Down Expand Up @@ -179,7 +180,6 @@ func (e *executor) read() {
}
<-stderrDone
_ = e.base.process.Wait()
e.base.stopWorkspaceDirectories()
e.mu.Lock()
e.invalid = true
if e.active != nil {
Expand Down Expand Up @@ -317,7 +317,3 @@ func (s *session) invalidate() {
s.process.Cancel()
}
}

func (e *executor) ListWorkspaceDirectory(ctx context.Context, path string, maxEntries int) (agent.WorkspaceDirectoryResult, error) {
return e.base.ListWorkspaceDirectory(ctx, path, maxEntries)
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func preparationRequest() proto.PromptRequestPayload {
func runPreparationHelper() {
mode := os.Getenv("SDK_HELPER_MODE")
if len(os.Args) > 1 && strings.HasSuffix(os.Args[1], "runtime_check.js") {
features := []string{"workspace_tools", "workspace_prepare", "workspace_command_observations", "workspace_directory"}
features := []string{"workspace_tools", "workspace_prepare", "workspace_command_observations"}
if mode == "old-runtime" {
features = []string{"workspace_tools"}
} else if mode == "old-command-runtime" {
Expand Down Expand Up @@ -85,10 +85,6 @@ func runPreparationHelper() {
}
}
emit(bridgeEvent{Type: "executor_ready", Protocol: 3})
if strings.HasPrefix(mode, "directory-") {
runWorkspaceDirectoryHelper(scanner, state, mode)
return
}
if !scanner.Scan() {
return
}
Expand Down
13 changes: 6 additions & 7 deletions apps/daemon/internal/agent/claudesdk/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@ type session struct {
cancelOutput chan struct{}
nativeEnded bool

directories workspaceDirectoryState
process *clirunner.Process
writeMu *sync.Mutex
functions functionState
steering steeringState
settled chan struct{}
outcome proto.DonePayload
process *clirunner.Process
writeMu *sync.Mutex
functions functionState
steering steeringState
settled chan struct{}
outcome proto.DonePayload
}

type bridgeEvent struct {
Expand Down
15 changes: 0 additions & 15 deletions apps/daemon/internal/agent/claudesdk/unsupported.go

This file was deleted.

34 changes: 0 additions & 34 deletions apps/daemon/internal/agent/claudesdk/unsupported_test.go

This file was deleted.

Loading
Loading