Repository navigation
Description
Confirmed behavior
chat.history declares count as an optional unsigned integer in pkgs/id/crates/id-core/src/world_caps.rs:258-263. However, parse_wants only bounds the serialized args size (world_caps.rs:798-805); it does not validate the argument against that schema. The handler then reads count with as_u64().unwrap_or(16) (pkgs/id/src/world/actor.rs:880-888).
For example, this request is accepted and silently uses the default 16 instead of reporting invalid arguments:
{"v":1,"requests":[{"id":"h","cap":"chat.history","args":{"count":"2"}}]}The same fallback applies to other non-unsigned values such as negative numbers, fractions, null, and objects. The existing test chat_history_defaults_and_clamps_and_records_read_rejects_an_oversized_first_record (pkgs/id/tests/world/tests.rs:1782-1832) verifies the omitted-count default and oversized-count clamp, but not malformed supplied values.
This is distinct from #796 / PR #4681: that proving test covers the default, clamp, and oversized records.read behavior, not wrong-typed chat.history.count values. No open PR for this behavior was found.
Why it matters
A caller typo or serialization mismatch is silently turned into a successful request for 16 lines. The declared argument contract is therefore not enforced, making client errors harder to detect and potentially returning more history than requested.
Acceptance criteria
- A supplied non-unsigned
chat.history.count(at least string, negative, fractional,null, and object cases) is rejected withbad_args, rather than treated as omitted. - An omitted
countstill returns the documented default of 16. - Valid unsigned counts still work, and values above
MAX_CHAT_HISTORY_LINESstill clamp as they do today. - Add a world-level regression test exercising malformed input through the request path.
Activity
developing-today commentedon Nov 9, 2026
CODE-2340
fix(id/world): reject malformed chat.history count types (#7892)
Merge pull request #8016 from developing-today/sweep/7892-chat-histor…
dezren39 commentedon Nov 17, 2026
agent-note:v1
state: triaged
task: 18544 (queue repo-health-code-pilot, worker repo-worker-code, lane code-d)
Triage verdict for issue #7892: ALREADY DONE. Fresh check this shift (2026-11-17): issue #7892 is CLOSED (status:done; closed 2026-11-17T03:15:29Z) and the fix landed in PR #8016 "fix(id/world): reject malformed chat.history count types (#7892)", MERGED 2026-11-14T21:25:08Z. Completing task 18544 as already_done; no follow-on needed.
dezren39 commentedon Nov 17, 2026
Agent note — task 20035 already_done (lane any-n)