JSON Schema accepts numbers such as 3.0 as integers, but Python decodes
that representation as float. Tool calls with valid integral arguments
were therefore rejected before execution, including nullable and union
integer schemas.
Share the integer check across schema validation and union matching, then
convert integral floats to int before calling the tool. Keep fractional
values, booleans, and non-finite numbers outside the integer type.
Add schema and registry regressions for integral JSON numbers.
Validation: 144 tool-validation tests; Ruff; BasedPyright;
import-boundary checks; git diff --check.
* fix(deepseek): preserve vision for legacy Flash aliases
* fix(deepseek): expose validated model catalog capabilities
* fix(deepseek): retain explicit off control with live reasoning levels
* docs: clarify provider-specific model guidance
Napcat reports an image segment's file_size as a string that is not
always numeric, so int() raises ValueError. The upfront size guard only
caught TypeError and KeyError, the ValueError escaped _download_image
into _on_message, and the whole inbound message was dropped — text
included — with only a background-handler warning left behind.
Handle ValueError as the guard already handles a missing size: skip the
upfront check and let the streamed download enforce max_image_bytes.
Log it, since a declared size we cannot read is worth knowing about.
The Markdown-to-HTML converter only protected ``` blocks, and closed a
block at the first ``` it met. A ~~~ block was formatted as prose ("#
setup" turned bold, __init__ into <b>init</b>), and a ```` block showing a
``` example rendered as an empty <pre> followed by leaked, re-formatted
text.
Protect fenced blocks line by line first: open on ``` or ~~~, close on a
run of the same character at least as long. One-line ```code``` and
unclosed fences keep the previous regex handling. The streaming preview
strips fences through the same helper.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keep extracted spreadsheet text unchanged and carry actual cell start offsets into grep headers. Add real workbook GrepTool regressions and plain/empty-cell controls. Focused literal-source extraction/ContentPage replay passes; full GrepTool and required CI remain pending.
The 80-character stem limit can still produce a filename longer than 255
bytes when a document name contains CJK characters or emoji. Adding the
upload ID then makes an otherwise valid document name fail on disk.
Retain the character limit and trim only stems that exceed the remaining
byte budget after the ID, separator, and extension. Decode at a character
boundary so the saved name remains valid Unicode.
Add file-write regressions for CJK and emoji document names.
Validation: 38 media and attachment-store tests; Ruff; BasedPyright;
import-boundary checks; git diff --check.
The Developer Manual documents 400/100 as meaning "the API token is
present but not valid" only on endpoints without media. Media methods
share that same status and code with an unknown or expired media id and
with a length cap.
Classifying a 400 from `GET /media/<id>` as an invalid token would stop
the channel because one attachment expired, so media requests now pass
`media_endpoint=True` and the heuristic is skipped for them. A malformed
Authorization header (401/190) is still recognised on every endpoint.
Also corrects the state module docstring: the store keeps the cursor,
dedup window, creator identifier, and delivery receipts, and holds no
token material.
Adds `whatsapp_agent`, an additive channel that connects nanobot to the
official WhatsApp Agent Platform API (https://api.whatsapp.com/agent/v1).
It authenticates with a per-agent API token and long-polls `GET /updates`
instead of linking a device, so it is the officially supported interface
rather than the Neonize linked-device protocol used by the existing
`whatsapp` channel.
The existing `whatsapp` channel is unchanged; both can run at once under
different names.
Design notes:
- The poll cursor, dedup window, and creator identifier live in one
atomically replaced state file. A message id is recorded before it is
handled, so a crash re-reads the batch without answering twice, and the
cursor is only accepted after the batch is processed.
- The first poll omits `offset`, which resolves the head and never replays
up to 30 days of history into an auto-replying agent.
- A changed token resets the cursor, because `next_offset` is only valid
for the agent that issued it.
- Each API method is paced below its own rolling 60-second limit, and
progress/tool-hint messages default to off because they spend the shared
12-per-minute send budget.
- Retries are limited to confirmed non-delivery (`429`, `503`/`131016`).
A `500` or read timeout is ambiguous, so it is not retried unless
`retryAmbiguousSends` is set; a duplicate is worse than a missed reply.
- Inbound media is downloaded through the shared SSRF guard, size-capped,
and verified against the reported digest. Outbound media is validated
before upload.
- Reactions are receive-only, matching the API. The token is never logged
or persisted; state stores only a SHA-256 fingerprint.
Docs compare both WhatsApp channels, including the lack of end-to-end
encryption, country availability, and rate limits.