fakeacp

package
v0.6.76 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2026 License: AGPL-3.0, Apache-2.0, MIT Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package fakeacp is a scripted ACP v1 agent for tests. A test binary re-executes itself with EnvVar=1 and calls Main from TestMain; the agent then speaks ACP over stdio, logs every request it receives to $LogEnv (one JSON object per line), and scripts each turn from the prompt's first text block:

slow:<ms>   sleep, tracking concurrent turns (logged as {"method":"_active","n":N})
block       wait for session/cancel, then stop with "cancelled"
permission  ask session/request_permission and echo the outcome
subagent    a Task tool call and a child update tagged with claude-agent-acp's parentToolUseId
subagent-permission  a subagent's tool call, then a permission request for it on the parent session
native-subagent  claude-agent-acp's native subagent session: subagent_spawned, the child's own updates and a
            permission request on the child's session ID, then subagent_state_update
opencode-subagent  an OpenCode task: the child session is named only on the $OpenCodeEnv event stream and
            streams (and asks for permission) once the client opens it with session/resume
replay:<path>  send each session update in a JSON array file, as captured from a real adapter, on the prompted
            session, or on another as {"sessionId": ..., "update": ...}
unknown     an unknown content block and an unknown session update kind
authfail    fail the turn with -32000 "Authentication required"
mode:<id>   switch the session's mode itself (current_mode_update), like leaving plan mode
anything    echo it back as "echo:<text>"

Like a Claude model without Auto support, the "smart" model answers the auto mode with acceptEdits.

Index

Constants

View Source
const (

	// EnvVar makes a re-executed test binary run the fake agent.
	EnvVar = "DEVBOX_FAKE_ACP"
	// LogEnv is the request log path.
	LogEnv = "FAKE_ACP_LOG"
)
View Source
const OpenCodeChild = "ses_child"

OpenCodeChild is the child session the opencode-subagent scenario's task spawns.

View Source
const OpenCodeEnv = "FAKE_OPENCODE_ADDR"

OpenCodeEnv is the address the fake serves an OpenCode-style /global/event stream on; the stream requires basic auth as opencode:$OPENCODE_SERVER_PASSWORD.

Variables

This section is empty.

Functions

func Enabled

func Enabled() bool

Enabled reports whether this process should be the fake agent.

func Main

func Main()

Main runs the fake agent until stdin closes.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL