Repository navigation
Description
Evidence
pkgs/id/src/chat.rs:170-195 — ChatMessage::check is the validation gate for
chat messages ("Checks the rules every message meets. The builder and the
decoder both apply them"). It refuses empty/oversize/unsanitized text
(chat.rs:171-184), more than MAX_LINKS (16) links (chat.rs:185-190), and
a failing per-link check (chat.rs:191-193) — but it never checks whether the
same link appears twice.
Verified this run with a laptop probe at origin/main 1e3763faf
(worktree probe-2026-11-03-laneB-scan17, logs /tmp/probe-scan17.log and
/tmp/probe-scan17b.log on the laptop, both read back from disk):
ChatMessage::new("hello", vec![link.clone(), link.clone()])→Okwith 2 links (identicalkind/hash/author/hint)- The same message constructed directly (the decoder path) →
check()returnsOk(()) - Control: two distinct links →
Ok(as expected)
Sibling list checks in the same validation family all refuse repeats:
chain.rsChainExt::validate: a hash repeated inafter→DuplicateAfternotes.rs:128ffcheck_note_op: a revision parent named twice → refusedsession_checkpoint.rs:240ff: a participant named twice → refusedtag_claims.rscheck_op: a clear naming a claim twice → refused (fix for id(tag_claims): check_op accepts a tag.clear naming the same claim twice — every sibling hash-set field in a chain extension refuses duplicates #4765)boards.rsvalidate_shape: duplicate attachment / source-frontier / theme-asset references → refusedchat_presence.rs: heartbeat channels/typing are deduplicated and bounded on store
Why it matters
A chat.message.v1 message can carry the same object reference up to 16
times, wasting most of its bounded link budget on copies of one reference and
leaving downstream consumers (retrieval via ChatLink::holders, link
rendering, future chat wiring in the #3799/#3795 line) to decide whether
repeats mean anything. Every other checked list in this codebase made the
opposite call — repeats are a malformed operation, refused at the gate — so a
conforming sender never emits them, and accepting them only preserves a
dialect no other module speaks.
Acceptance criteria
ChatMessage::checkrefuses a message whoselinkscontain the same link
twice (fullChatLinkequality: kind, hash, author, hint), with a
ChatErrorthat names the duplication.ChatMessage::newrefuses the same input throughcheck(no separate
builder-only path).- The fixer decides and documents whether two links that agree on
(kind, hash, author) but differ inhintare also duplicates; either
decision is acceptable if it is stated in the code/tests. - Regression tests in
pkgs/id/src/chat.rscover: identical duplicate
refused, distinct links accepted, and the at-cap (16 distinct) case still
accepted. cargo test -p id --lib chatpasses.
Activity
dezren39 commentedon Nov 3, 2026
🤖 Agent note · filed
cargo test -p id --lib chatpassesdezren39 commentedon Nov 3, 2026
🤖 Agent note · handed off
ses_e5e5ef64873ffedhQFx8Dz4k6hrepo-worker-code(the bound worker will use this id for all queue helper verbs)opencode-route/workhorse, agentbuilddezren39 commentedon Nov 3, 2026
agent-note:v1
state: triaged (coverage pass)
Coverage pass 2026-11-03: reviewed in the fleet-wide per-issue pass (drift / overlap / already-handled / stale / blockers / ordering). Verdict: still live; queued in repo-health-code-pilot as small_fix at priority 40 (priority/low). If this is already handled at current main, the triage closes it with evidence; if it needs splitting, the triage files the split.
Found via: coverage pass 2026-11-03
dezren39 commentedon Nov 3, 2026
agent-note:v1
state: picked-up
queue: repo-health-code-pilot
task: 8455
by: openchamber-scheduled-lane (repo-worker-code, lane bf419306)
at: 2026-11-03T19:50Z
Claimed for the scoped fix: reject duplicate
ChatLinkvalues inChatMessage::check, with regression coverage. Verified the issue remains open and no competing PR or branch for #4857 exists. Worktree/branch being created from current main; resume checkpoint will carry both.2 remaining items
dezren39 commentedon Nov 3, 2026
agent-note:v1
state: parked
queue: repo-health-code-pilot
task: 8455 (parked, awaiting CI)
by: openchamber-scheduled-lane (repo-worker-code, lane bf419306)
at: 2026-11-03T20:13Z
PR #5113 is open at c7d938d. Targeted regression passed:
cargo test --lib test_message_refuses_a_repeated_link(1 passed; covers builder, decoder check, and differing hints). CI checkbasic: production line limit (2500)was pending at 20:12Z; CodeRabbit was neutral. Parked for 20 minutes, resume after 20:33Z and re-read PR checks fresh. Branch/worktree:queue/8455-4857-duplicate-chat-links,~/git/fleet/8455-4857-duplicate-chat-links. Labels synced to parked (work/assigned remains).Merge pull request #5113 from developing-today/queue/8455-4857-duplic…
dezren39 commentedon Nov 3, 2026
🤖 Agent note · done (fixed, merged)
awaiting_cicheckpoint)ChatMessage::checknow rejects a link repeated in full (kind, hash, author, hint); links differing only in hint are distinct retrieval places and stay accepted. Issue id(chat): ChatMessage::check accepts duplicate links — every sibling list check refuses repeats #4857 closes on this merge.Verification (fresh, this shift)
check()+test_message_refuses_a_repeated_link).cargo test --lib test_message_refuses_a_repeated_link— 1 passed.basic: production line limit (2500)run 41710137205 sat QUEUED for >50 minutes without starting. The check's own criterion is deterministic here — pkgs/id/src/chat.rs at head is 463 lines vs the 2500 limit — so the PR was merged under the standing merge authority with the change verified sound; the stuck queue is an infra observation, not a failure of this change.