Skip to content

core: skip the model for human-directed web project mentions - #854

Open
irisfeng wants to merge 1 commit into
yc-software:mainfrom
irisfeng:feat/human-mention-no-model
Open

core: skip the model for human-directed web project mentions#854
irisfeng wants to merge 1 commit into
yc-software:mainfrom
irisfeng:feat/human-mention-no-model

Conversation

@irisfeng

@irisfeng irisfeng commented Aug 30, 2026

Copy link
Copy Markdown

Problem

In web project chats, a message from a human that @-mentions another human member is person-to-person communication routed through the bot. Running it through the model costs a turn, adds latency, and can make the model interject where nobody asked it to.

Change

Append the message to the session transcript and end the turn silently ({status: "silent"}) when the incoming web group turn:

  • is human-originated (origin.kind === "human"),
  • carries no approval and no attachments,
  • mentions another named member of the conversation audience.

Details worth review attention:

  • Matching runs on the display text, not input.text. For web group human turns the spine rewrite substitutes a wake envelope for input.text and moves the typed message to displayText; the envelope's metadata carries the sender's identity, so matching (and the bot-name veto) must read the display form — otherwise any sender whose id contains the bot label is silently excluded.
  • CJK-aware matching (new src/core/orchestrator/human-mention.ts): no-space boundaries; single-character surname prefixes stay ambiguous (not human-directed); an ASCII token that merely starts with a member name (@sample vs a member named Sam) does not match; CJK-suffixed extensions (@李四这个方案) do; self- and bot-mentions are ignored; email addresses do not count.
  • Attachments opt out: turns with attachments keep the model path, because the silent path would persist raw blob references that are never materialized and cannot be fetched by any viewer.

Slack-originated turns are untouched (web-surface only).

Tests

Unit tests for the matcher plus app-level integration tests through app.turn with a real project fixture: silent append of the typed message; the envelope-metadata veto case (sender id containing the bot label stays silent); mention-with-attachment still reaches the model; slack-originated mention still reaches the model. Full orchestrator suite passes (132 tests).


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

In web project chats, a message from a human that @-mentions another
human member is person-to-person communication routed through the bot.
Running it through the model costs a turn, adds latency, and can make
the model interject where nobody asked it to.

Append the message to the session transcript and end the turn silently
when the incoming web group turn is human-originated, carries no
approval and no attachments, and mentions another named audience
member. Matching runs on the display text, not the wake envelope the
spine rewrite substitutes for input.text — envelope metadata carries
the sender's identity and would trip the bot-name veto for any sender
whose id contains the bot label. CJK-aware matching: no-space
boundaries, single-character surname prefixes stay ambiguous, ASCII
tokens that merely start with a member name do not match, self- and
bot-mentions are ignored, emails do not count. Turns with attachments
keep the model path so inbound files are materialized and viewable
instead of persisting unfetchable blob references.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant