Skip to content

Feat/agent personality#9

Merged
arvindrk merged 6 commits into
mainfrom
feat/agent-personality
May 9, 2026
Merged

Feat/agent personality#9
arvindrk merged 6 commits into
mainfrom
feat/agent-personality

Conversation

@arvindrk
Copy link
Copy Markdown
Owner

@arvindrk arvindrk commented May 9, 2026

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:

  1. 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.

  2. Infinite probing in 1:1 threads. The probe stance 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:

  • Rewrote ## Voice in inbound-engagement.ts SYSTEM prompt: humor-first, extremely short, dry delivery.
  • Softened the AI-concealment rule from "never hint at it" to "don't announce or dwell on it; don't deny if sincerely asked" — consistent with the public bio.
  • Same voice upgrade applied to 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 in thread[]
  • uniqueOthers — unique other participants in the thread
  • forceClose: true when agentReplies === 2 && uniqueOthers <= 1 (3rd reply → forced close)
  • skip: true when agentReplies >= 3 && uniqueOthers <= 1 (4th+ → silent, no reply)
  • Multi-party threads (uniqueOthers > 1) are never capped — only continue if more people join

The cap is enforced at the service layer in engagement.ts, not left to the LLM:

  • On skip: marks engagement as skipped, no agent call.
  • On forceClose: passes the instruction to the agent via the user message ("this is your final reply, use stance close"), then overrides the stance to close in the service if the LLM returns probe anyway.

Requires X_HANDLE env var (agent's handle without @) to identify its own messages in thread history.

Checklist

  • bun run typecheck passes
  • bun run test passes
  • bun run format:check passes
  • Layer rules in AGENTS.md respected (no cross-layer imports)
  • No dead, commented-out, or duplicate code introduced

@vercel
Copy link
Copy Markdown

vercel Bot commented May 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
twitter-agent Ready Ready Preview, Comment May 9, 2026 0:31am

@arvindrk arvindrk merged commit 7978cd6 into main May 9, 2026
6 checks passed
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