Feat/agent personality#9
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Upgrade agent voice to funny/witty/short and enforce a hard 1:1 thread depth cap so the agent stops probing indefinitely in one-on-one conversations.
Why
Two behavioral problems with the current agent:
Voice was wrong for the account. The bio now publicly identifies this as an AI agent, and the voice was dry/corporate-technical. Replies need to be funny, punchy, and short — humor through compression and timing, not through effort.
Infinite probing in 1:1 threads. The
probestance had no limit. In a 1:1 reply chain, each probe triggers another webhook event, and the agent would keep firing questions indefinitely — annoying users and burning tokens with no ceiling.How
Voice:
## Voiceininbound-engagement.tsSYSTEM prompt: humor-first, extremely short, dry delivery.writer.ts: adds setup-punchline preference, dry humor over effort-humor.Thread depth cap — two-layer enforcement:
computeThreadMeta()(pure, exported, tested) computes per-event:agentReplies— how many times the agent's handle appears inthread[]uniqueOthers— unique other participants in the threadforceClose: truewhenagentReplies === 2 && uniqueOthers <= 1(3rd reply → forced close)skip: truewhenagentReplies >= 3 && uniqueOthers <= 1(4th+ → silent, no reply)uniqueOthers > 1) are never capped — only continue if more people joinThe cap is enforced at the service layer in
engagement.ts, not left to the LLM:skip: marks engagement as skipped, no agent call.forceClose: passes the instruction to the agent via the user message ("this is your final reply, use stance close"), then overrides the stance toclosein the service if the LLM returnsprobeanyway.Requires
X_HANDLEenv var (agent's handle without@) to identify its own messages in thread history.Checklist
bun run typecheckpassesbun run testpassesbun run format:checkpassesAGENTS.mdrespected (no cross-layer imports)