picoclaw/pkg/agent
Yue_chen a680d8fcfa fix(tools): gate write_file overwrite guidance on available tools
#3150 reworded write_file's description, overwrite parameter, and guard
error to prefer append_file/edit_file. But those tools register via their
own enable flags and the per-agent allowlist, so a config exposing only
write_file was steered toward tools it does not have — a dead end in the
most restrictive setups.

WriteFileTool now tracks which non-destructive alternatives are available
and names only the ones present; when none are, the guard still blocks the
overwrite without pointing anywhere. The agent wiring registers the editors
before write_file and resolves availability via registry.HasRegistered,
which reflects both the enable flag and the allowlist.

Tests: conditional copy at the tool level (none/one/both) and agent wiring
across the enable-flag and allowlist dimensions.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-07 20:40:27 +08:00
..
adapters feat: support streaming (#2892) 2026-05-19 16:38:47 +08:00
interfaces feat: support streaming (#2892) 2026-05-19 16:38:47 +08:00
agent.go Merge pull request #2904 from SiYue-ZO/feature/fix-agent-loop-stability 2026-06-14 21:22:53 +02:00
agent_command.go refactor(agent): route /clear through ContextManager.Clear for all agents 2026-07-04 14:04:37 +08:00
agent_event.go feat: agent self evolution (#2847) 2026-05-11 16:13:27 +08:00
agent_init.go Merge pull request #2904 from SiYue-ZO/feature/fix-agent-loop-stability 2026-06-14 21:22:53 +02:00
agent_inject.go
agent_mcp.go fix(agent): suppress MCP discovery when no servers are selectable 2026-05-08 13:48:47 +02:00
agent_mcp_test.go fix(agent): suppress MCP discovery when no servers are selectable 2026-05-08 13:48:47 +02:00
agent_media.go WIP: Initial support for deltachat gateway 2026-07-02 15:23:35 +02:00
agent_message.go feat: add request-scoped context policies (#2914) 2026-05-22 10:06:40 +08:00
agent_options.go
agent_outbound.go fix(providers): surface friendly auth error messages (#3198) 2026-06-30 17:42:07 +08:00
agent_steering.go fix(agent): drain scoped follow-up queue when pending stop skips turn startup 2026-05-05 19:24:15 +02:00
agent_stop.go fix(agent): don't arm pending stop when /stop targets idle session 2026-05-04 13:10:02 +02:00
agent_test.go fix(agent): clear routed agent session 2026-07-04 04:14:03 +08:00
agent_transcribe.go
agent_utils.go Merge pull request #2904 from SiYue-ZO/feature/fix-agent-loop-stability 2026-06-14 21:22:53 +02:00
agent_utils_test.go fix(agent): send SVG attachments as files 2026-05-05 19:36:09 +08:00
context.go fix(agent): handle os.Getwd error in NewContextBuilder without behavior regression 2026-06-08 16:52:00 +08:00
context_budget.go fix(seahorse): enforce budget on fresh tail and rebuild paths 2026-05-18 21:11:21 +02:00
context_budget_test.go fix(seahorse): enforce budget on fresh tail and rebuild paths 2026-05-18 21:11:21 +02:00
context_cache_test.go
context_legacy.go refactor(agent): route /clear through ContextManager.Clear for all agents 2026-07-04 14:04:37 +08:00
context_manager.go
context_manager_test.go refactor(agent): route /clear through ContextManager.Clear for all agents 2026-07-04 14:04:37 +08:00
context_seahorse.go refactor(agent): route /clear through ContextManager.Clear for all agents 2026-07-04 14:04:37 +08:00
context_seahorse_test.go fix(seahorse,session): preserve created_at across history bootstrap 2026-05-26 14:05:20 +08:00
context_seahorse_unsupported.go
context_test.go
context_usage.go fix(context): expose history tokens and remove leaked state files 2026-06-06 00:28:32 +08:00
definition.go
definition_test.go
discovery.go fix(agent): hide discovery when spawn is unavailable 2026-05-08 22:23:50 +02:00
discovery_test.go fix(agent): hide discovery when spawn is unavailable 2026-05-08 22:23:50 +02:00
dispatch_request.go
dispatch_request_test.go
error_format.go fix(providers): surface friendly auth error messages (#3198) 2026-06-30 17:42:07 +08:00
error_format_test.go fix(providers): surface friendly auth error messages (#3198) 2026-06-30 17:42:07 +08:00
event_payloads.go feat: agent self evolution (#2847) 2026-05-11 16:13:27 +08:00
eventbus_test.go
events.go feat: agent self evolution (#2847) 2026-05-11 16:13:27 +08:00
events_runtime.go fix(events): keep runtime observers non-blocking 2026-04-27 13:09:03 +08:00
evolution_bridge.go fix(evolution): skip cold path for heartbeat turns 2026-06-24 23:29:46 +08:00
evolution_bridge_test.go fix(evolution): skip cold path for heartbeat turns 2026-06-24 23:29:46 +08:00
hook_mount.go fix(events): keep runtime observers non-blocking 2026-04-27 13:09:03 +08:00
hook_mount_test.go fix(events): keep runtime observers non-blocking 2026-04-27 13:09:03 +08:00
hook_process.go
hook_process_test.go
hooks.go
hooks_test.go
instance.go fix(tools): gate write_file overwrite guidance on available tools 2026-07-07 20:40:27 +08:00
instance_test.go fix(tools): gate write_file overwrite guidance on available tools 2026-07-07 20:40:27 +08:00
legacy_events.go fix(agent): log warning when LoadAndDelete type assertion fails 2026-06-06 00:32:49 +08:00
legacy_events_test.go feat: agent self evolution (#2847) 2026-05-11 16:13:27 +08:00
llm_media.go fix(agent): keep media routing scoped to current turn 2026-06-13 11:38:08 +02:00
memory.go
mock_provider_test.go
model_resolution.go feat(chat,seahorse): persist and display model_name across history (#2897) 2026-05-20 13:42:21 +08:00
model_resolution_test.go feat(chat,seahorse): persist and display model_name across history (#2897) 2026-05-20 13:42:21 +08:00
pipeline.go
pipeline_execute.go fix(agent): limit media routing to the active turn 2026-06-13 00:25:45 +02:00
pipeline_execute_test.go feat: agent self evolution (#2847) 2026-05-11 16:13:27 +08:00
pipeline_finalize.go feat: add request-scoped context policies (#2914) 2026-05-22 10:06:40 +08:00
pipeline_llm.go fix(pico): deliver per-turn token usage to the streamer 2026-06-22 15:38:46 +02:00
pipeline_setup.go fix(agent): keep media routing scoped to current turn 2026-06-13 11:38:08 +02:00
pipeline_streaming.go feat(pico): emit real per-turn token usage on finalized message 2026-06-22 13:15:35 +02:00
pipeline_streaming_test.go fix(agent): honor explicit thinking off (#2898) 2026-05-21 11:07:39 +08:00
prompt.go fix(agent): limit media routing to the active turn 2026-06-13 00:25:45 +02:00
prompt_contributors.go feat: add request-scoped context policies (#2914) 2026-05-22 10:06:40 +08:00
prompt_test.go feat: add request-scoped context policies (#2914) 2026-05-22 10:06:40 +08:00
prompt_turn.go fix(agent): keep media routing scoped to current turn 2026-06-13 11:38:08 +02:00
registry.go fix(agent): hide discovery when spawn is unavailable 2026-05-08 22:23:50 +02:00
registry_test.go
runtime_event_logger.go
runtime_event_logger_test.go fix(agent): replace WaitGroup with Cond-based counter and conditionalize panic cleanup 2026-06-15 01:32:13 +08:00
runtime_event_test.go
steering.go feat(agent): stop command 2026-05-04 08:41:17 +02:00
steering_test.go fix(test): read back history after SetHistory in steering test for CreatedAt normalization 2026-05-22 13:15:56 +08:00
subturn.go feat: add request-scoped context policies (#2914) 2026-05-22 10:06:40 +08:00
subturn_test.go Merge pull request #2531 from is-Xiaoen/feat/delegate-tool 2026-05-07 11:25:41 +08:00
thinking.go fix(agent): honor explicit thinking off (#2898) 2026-05-21 11:07:39 +08:00
thinking_test.go
tool_allowlist.go fix(agent): treat empty AGENT.md tools as allow none 2026-05-09 10:35:13 +02:00
tool_allowlist_test.go fix(agent): treat empty AGENT.md tools as allow none 2026-05-09 10:35:13 +02:00
turn_context.go
turn_coord.go fix(agent): keep media routing scoped to current turn 2026-06-13 11:38:08 +02:00
turn_coord_test.go fix(agent): retry transient LLM HTTP errors using provider error classifier 2026-06-02 19:58:09 +08:00
turn_profile_policy.go feat: add request-scoped context policies (#2914) 2026-05-22 10:06:40 +08:00
turn_profile_test.go fix(session): normalize CreatedAt in SessionManager AddFullMessage/SetHistory 2026-05-22 13:42:35 +08:00
turn_state.go Merge pull request #2904 from SiYue-ZO/feature/fix-agent-loop-stability 2026-06-14 21:22:53 +02:00
turn_state_test.go fix(agent): preserve active turn during context retry rebuild 2026-05-19 09:18:39 +02:00