From 1faf4777f66700f3d4897fc43b68e4c983d17ad3 Mon Sep 17 00:00:00 2001 From: Alex Castillo Date: Wed, 21 Oct 2026 13:21:21 -0400 Subject: [PATCH] docs: replace the retired claude-sonnet-4 in btw examples and the client error message Co-Authored-By: Claude Sonnet 5.5 --- NEWS.md | 2 ++ R/btw_client.R | 6 +++--- R/btw_task.R | 2 +- R/tool-agent-custom.R | 4 ++-- R/tool-agent-subagent.R | 2 +- man/btw_agent_tool.Rd | 4 ++-- man/btw_client.Rd | 2 +- man/btw_task.Rd | 2 +- man/btw_tool_agent_subagent.Rd | 2 +- 9 files changed, 14 insertions(+), 12 deletions(-) diff --git a/NEWS.md b/NEWS.md index ae2261c7..248fbd8e 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,7 @@ # btw (development version) +* The documentation and the `btw_client()` error message now use `claude-sonnet-5-5` in their examples, instead of `claude-sonnet-4` and `claude-sonnet-4-20250514`, which Anthropic has retired. + * `path_find_in_project()` now stops its upward search when it reaches the home directory (either `fs::path_home()` or `fs::path_home_r()`, which differ on Windows) and never treats files there as project files, so `~/AGENTS.md` or `~/CLAUDE.md` are no longer picked up as project context when the working directory is under `~` but outside a project. Home-level files are handled only by the user-level lookup. This also fixes `~/btw.md` instructions being included twice — once as the project file and once as the user-level config (#225). * `btw_client(path_btw = ...)` no longer duplicates instructions when `path_btw` is set explicitly to the same file as the user-level `btw.md` (#225). diff --git a/R/btw_client.R b/R/btw_client.R index b15568b3..60d3407b 100644 --- a/R/btw_client.R +++ b/R/btw_client.R @@ -56,7 +56,7 @@ #' **Array format** (unnamed list): #' ```yaml #' client: -#' - anthropic/claude-sonnet-4 +#' - anthropic/claude-sonnet-5-5 #' - openai/gpt-4.1 #' - aws_bedrock/us.anthropic.claude-sonnet-4-20250514-v1:0 #' ``` @@ -302,8 +302,8 @@ as_ellmer_client <- function(client) { cli::cli_abort(c( "{.arg client} must be an {.help ellmer::Chat} client, a {.val provider/model} string, or a list with {.field provider} (and optionally {.field model}).", - "i" = "Examples: {.or {.val {c('openai/gpt-4.1-mini', 'anthropic/claude-sonnet-4-20250514')}}}.", - "i" = "Or as a list: {.code list(provider = 'anthropic', model = 'claude-sonnet-4-20250514')}" + "i" = "Examples: {.or {.val {c('openai/gpt-4.1-mini', 'anthropic/claude-sonnet-5-5')}}}.", + "i" = "Or as a list: {.code list(provider = 'anthropic', model = 'claude-sonnet-5-5')}" )) } diff --git a/R/btw_task.R b/R/btw_task.R index c82dedf4..75d516f0 100644 --- a/R/btw_task.R +++ b/R/btw_task.R @@ -14,7 +14,7 @@ #' --- #' client: #' provider: anthropic -#' model: claude-sonnet-4 +#' model: claude-sonnet-5-5 #' tools: [docs, files] #' --- #' diff --git a/R/tool-agent-custom.R b/R/tool-agent-custom.R index 501ca7e5..31cd7fea 100644 --- a/R/tool-agent-custom.R +++ b/R/tool-agent-custom.R @@ -27,7 +27,7 @@ NULL #' * `title`: User-facing title for the tool. Defaults to title-cased name. #' * `icon`: Icon specification for the agent (see **Icon Specification** #' below). Defaults to the standard agent icon. -#' * `client`: Model specification like `"anthropic/claude-sonnet-4-20250514"`. +#' * `client`: Model specification like `"anthropic/claude-sonnet-5-5"`. #' Falls back to `btw.subagent.client` or `btw.client` options. #' * `tools`: List of tool names or groups available to this agent. Defaults to #' all non-agent tools. @@ -113,7 +113,7 @@ NULL #' @param path Path to an agent markdown file. #' @param client Optional. A client specification to override the agent's #' configured client. Can be a string like -#' `"anthropic/claude-sonnet-4-20250514"`, an [ellmer::Chat] object, or a list +#' `"anthropic/claude-sonnet-5-5"`, an [ellmer::Chat] object, or a list #' with `provider` and `model` keys. If `NULL` (default), uses the `client` #' field from the agent file or falls back to btw's default client resolution. #' diff --git a/R/tool-agent-subagent.R b/R/tool-agent-subagent.R index ce9af33f..f57a8eef 100644 --- a/R/tool-agent-subagent.R +++ b/R/tool-agent-subagent.R @@ -82,7 +82,7 @@ BtwSubagentResult <- S7::new_class( #' # Configure the client and default tools for subagents #' withr::with_options( #' list( -#' btw.subagent.client = "anthropic/claude-sonnet-4-20250514", +#' btw.subagent.client = "anthropic/claude-sonnet-5-5", #' btw.subagent.tools_default = "files" #' ), #' { diff --git a/man/btw_agent_tool.Rd b/man/btw_agent_tool.Rd index 7ad6b5fd..c025691e 100644 --- a/man/btw_agent_tool.Rd +++ b/man/btw_agent_tool.Rd @@ -11,7 +11,7 @@ btw_agent_tool(path, client = NULL) \item{client}{Optional. A client specification to override the agent's configured client. Can be a string like -\code{"anthropic/claude-sonnet-4-20250514"}, an \link[ellmer:Chat]{ellmer::Chat} object, or a list +\code{"anthropic/claude-sonnet-5-5"}, an \link[ellmer:Chat]{ellmer::Chat} object, or a list with \code{provider} and \code{model} keys. If \code{NULL} (default), uses the \code{client} field from the agent file or falls back to btw's default client resolution.} } @@ -43,7 +43,7 @@ delegation message. \item \code{title}: User-facing title for the tool. Defaults to title-cased name. \item \code{icon}: Icon specification for the agent (see \strong{Icon Specification} below). Defaults to the standard agent icon. -\item \code{client}: Model specification like \code{"anthropic/claude-sonnet-4-20250514"}. +\item \code{client}: Model specification like \code{"anthropic/claude-sonnet-5-5"}. Falls back to \code{btw.subagent.client} or \code{btw.client} options. \item \code{tools}: List of tool names or groups available to this agent. Defaults to all non-agent tools. diff --git a/man/btw_client.Rd b/man/btw_client.Rd index dd43bf47..5a8051c6 100644 --- a/man/btw_client.Rd +++ b/man/btw_client.Rd @@ -133,7 +133,7 @@ first client is used automatically. \strong{Array format} (unnamed list): \if{html}{\out{
}}\preformatted{client: - - anthropic/claude-sonnet-4 + - anthropic/claude-sonnet-5-5 - openai/gpt-4.1 - aws_bedrock/us.anthropic.claude-sonnet-4-20250514-v1:0 }\if{html}{\out{
}} diff --git a/man/btw_task.Rd b/man/btw_task.Rd index 9b8c0604..184663f8 100644 --- a/man/btw_task.Rd +++ b/man/btw_task.Rd @@ -52,7 +52,7 @@ Task files use the same format as \code{btw.md} files: \if{html}{\out{
}}\preformatted{--- client: provider: anthropic - model: claude-sonnet-4 + model: claude-sonnet-5-5 tools: [docs, files] --- diff --git a/man/btw_tool_agent_subagent.Rd b/man/btw_tool_agent_subagent.Rd index 93d9fe5f..5a5c091b 100644 --- a/man/btw_tool_agent_subagent.Rd +++ b/man/btw_tool_agent_subagent.Rd @@ -111,7 +111,7 @@ filter on top of the resolved tools, regardless of their source. # Configure the client and default tools for subagents withr::with_options( list( - btw.subagent.client = "anthropic/claude-sonnet-4-20250514", + btw.subagent.client = "anthropic/claude-sonnet-5-5", btw.subagent.tools_default = "files" ), {