Skip to content

Linger is An Open-Source Personal Agent That Runs Fully on Your PC. We aim to break Big Tech’s grip on AI by bringing powerful local AI to everyday computers through efficient model–harness co-design, so everyone can run their own.

feat(computer): name Claude's web tools in every Operation

muterCc9901c7c5eff
diff --git a/apps/computer/local-daemon/README.md b/apps/computer/local-daemon/README.md
index 19a19b01..609f66e3 100644
--- a/apps/computer/local-daemon/README.md
+++ b/apps/computer/local-daemon/README.md
@@ -298,6 +298,9 @@ earlier Codex does not know the field and keeps the tools in code mode. The two
tool groups are therefore ordinary function tools, neither in code mode nor
deferred, like Codex's own `cua_repl` plugin: one model call is one JSON function
call, not a `text(await tools.mcp__computer__…)` script.
+Claude Code defers its own `WebSearch` and `WebFetch` behind `ToolSearch`, so
+every Claude Operation's developer instructions also name them and how to load
+them; Codex's `web_search` is not deferred and gets no such line.
On macOS these tools show only the fields the Computer routes. They hide Cua's `scope` and `capture_id`; only `click` takes `delivery_mode`, as described above.
Codex does not see the single macOS input tools: the `computer` server hides them
diff --git a/apps/computer/local-daemon/internal/linger/context/resolver.go b/apps/computer/local-daemon/internal/linger/context/resolver.go
index 33732c3b..bfa94a5c 100644
--- a/apps/computer/local-daemon/internal/linger/context/resolver.go
+++ b/apps/computer/local-daemon/internal/linger/context/resolver.go
@@ -43,6 +43,11 @@ type RegistrationBinding struct {
Status registration.Status
}
+// claudeWebToolGuide names Claude's web tools for every Operation. Claude Code
+// defers their definitions behind ToolSearch, so without it the model often
+// does not think to search the web, as with the Computer tools in ToolGuide.
+const claudeWebToolGuide = `Web tools: WebSearch searches the web and WebFetch reads one page. They are loaded on demand: before the first call, load them with ToolSearch (query "select:WebSearch,WebFetch").`
+
type ExecutionResolver struct {
// Bound by the local launcher; never accepted from a wire request.
ServiceCommand []string
@@ -136,6 +141,9 @@ func (r ExecutionResolver) Resolve(ctx context.Context, command protocol.Command
if r.ToolGuide != "" {
developerInstructions = strings.TrimSpace(developerInstructions + "\n\n" + r.ToolGuide)
}
+ if command.RuntimeType == "claude" {
+ developerInstructions = strings.TrimSpace(developerInstructions + "\n\n" + claudeWebToolGuide)
+ }
systemPrompt := strings.TrimSpace(strings.Join([]string{
instructionValue(request.SessionOptions.BaseInstructions),
developerInstructions,
@@ -158,7 +166,7 @@ func (r ExecutionResolver) Resolve(ctx context.Context, command protocol.Command
CodexVersion: installation.Version,
TenantID: command.TenantID, OwnerActorID: binding.OwnerActorID, AgentID: command.AgentID,
}
- if command.HostAccess == "trusted" || r.ToolGuide != "" {
+ if command.HostAccess == "trusted" || r.ToolGuide != "" || command.RuntimeType == "claude" {
spec.DeveloperInstructions = &developerInstructions
}
// The profile path is stable and depends only on the Agent-level credential,
diff --git a/apps/computer/local-daemon/internal/linger/context/resolver_test.go b/apps/computer/local-daemon/internal/linger/context/resolver_test.go
index c17a3c69..19c3c709 100644
--- a/apps/computer/local-daemon/internal/linger/context/resolver_test.go
+++ b/apps/computer/local-daemon/internal/linger/context/resolver_test.go
@@ -257,6 +257,38 @@ func TestExecutionResolverAppendsToolGuide(t *testing.T) {
}
}
+// Claude defers its web tools behind ToolSearch, so every Claude Operation
+// names them; Codex has its own web_search and gets nothing.
+func TestExecutionResolverNamesClaudeWebTools(t *testing.T) {
+ for _, runtimeType := range []string{"claude", "codex"} {
+ t.Run(runtimeType, func(t *testing.T) {
+ resolver := ExecutionResolver{
+ Providers: map[string]ProviderInstallation{runtimeType: {Type: runtimeType, ExecutablePath: "/local/bin/" + runtimeType}},
+ WorkspaceGrants: map[string]WorkspaceGrant{"grant-local": {GrantID: "grant-local", TenantID: "tenant-acme", Path: "/local/workspace"}},
+ Views: testContextViews{root: "/local/workspace"},
+ Registrations: map[string]RegistrationBinding{
+ "registration-local": {RegistrationID: "registration-local", TenantID: "tenant-acme", OwnerActorID: "actor-alice", ProviderType: runtimeType, Status: registration.StatusOnline},
+ },
+ }
+ spec, err := resolver.Resolve(context.Background(), protocol.Command{
+ TenantID: "tenant-acme", RegistrationID: "registration-local", AssignmentRevision: 1,
+ WorkspaceGrantID: "grant-local", RuntimeType: runtimeType, ContextViewRef: json.RawMessage(`{"receipt_ref":"receipt-1"}`),
+ }, json.RawMessage(`{"kind":"run.start","runtime":{"type":"`+runtimeType+`","model":"m"},"session_options":{"base_instructions":"Base","developer_instructions":"Developer"},"session":{"threadId":"thread-1"},"input":{"type":"text","text":"Go"}}`))
+ if err != nil {
+ t.Fatal(err)
+ }
+ named := strings.Contains(spec.SystemPrompt, "select:WebSearch,WebFetch")
+ if runtimeType == "claude" {
+ if !named || spec.DeveloperInstructions == nil || *spec.DeveloperInstructions != "Developer\n\n"+claudeWebToolGuide {
+ t.Fatalf("Claude web tools not named: %+v", spec)
+ }
+ } else if named || spec.DeveloperInstructions == nil || *spec.DeveloperInstructions != "Developer" {
+ t.Fatalf("Codex got the Claude web tool guide: %+v", spec)
+ }
+ })
+ }
+}
+
func TestBoundServiceGuidanceUsesLocalCommandOnly(t *testing.T) {
command := []string{"/opt/node", "/private install/cli.js", "--config", "/private/current.json"}
text := boundServiceInstructions(command)