claudeacp: Config.TaskTools gives each claude its to-do tools #14
Loading…
Reference in a new issue
No description provided.
Delete branch "todo-tools-env"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
At the owner's word ("Это нужно в claudeacp добавлять ... возможно как опцию"): the library that turns the Task tools into ACP plans sees to it that the claude it starts has them, as an option.
Config.TaskTools boolsetsCLAUDE_CODE_ENABLE_TODO_TOOLS=1in the environment of each claude the agent starts. Measured with claude 2.1.325 (-p --output-format stream-json --verbose, the tools of the init message): by default the Todo/Task family isTaskandTaskStop; with the variableTaskCreate,TaskGet,TaskList,TaskUpdateare there too (CLAUDE_CODE_ENABLE_TASKSchanges nothing). The caller's word wins: an agent environment or a session's_metaenv that already has the variable keeps its value, so0turns the tools off.Off by default, as
Config's other fields are (zero value = today's behaviour): an existing client that shows no plans has no use for the tools, and they lengthen claude's tool list. roomcity's host turns it on, one line with the go.mod bump after a release.Test:
TestTaskToolsVariablereads the launched process's environment (the spec the fake claude is spawned with): absent by default,1with the option, the session's0and the process environment's0kept. The README line where plans are described and the changelog say it.go test ./... -raceandgo vetpass. Command-line use is unchanged:claudeacp's own flags do not set it; a library caller does.No release in this PR: the version and its word are the owner's, to be cut as 0.6.0 was (a changelog heading and date in a pull request).
Read at
e14e8aa: the suite passes here under-race, and the option does what it says: off by default,1with it, and a value the agent's environment or the session's_metaalready holds is kept.Two things before it merges and is tagged.
CI / Lintis red:claudeacp/serve_test.go:305:13: Error return value of os.Unsetenv is not checked (errcheck).The comment on
Config.TaskToolscarries the reason for the default ("a client that shows no plans has no use for the tools, and they make claude's tool list longer") and the list of tools claude gains. The first is why this and not the other choice, which is the commit's to say, and the second is claude's, which changes without this line changing. What a caller is owed is the contract: it setsCLAUDE_CODE_ENABLE_TODO_TOOLS=1for each claude the agent starts, and leaves a value the environment or a session's_metaalready has.For the release: a pull request that moves Unreleased under the version and its date, as 0.6.0 was cut. The owner's word for releases now covers this repository (as specs-18 relays it), so I merge that one after reading it and the tag follows.