···109109RECONNECT_BACKOFF = [2, 5, 10, 20, 30]
110110TRANSCRIPT_MAX_TURNS = int(os.getenv("TRANSCRIPT_MAX_TURNS", "30")) # messages to send per convo (15 exchanges)
111111JOIN_GREET_CHANCE = float(os.getenv("JOIN_GREET_CHANCE", "0.15")) # 15% chance to greet on join
112112-RANDOM_CHIME_IN_CHANCE = float(os.getenv("RANDOM_CHIME_IN_CHANCE", "0.03")) # 3% chance to join conversation
113113-LISTEN_AND_DECIDE_CHANCE = float(os.getenv("LISTEN_AND_DECIDE_CHANCE", "0.10")) # 10% chance to evaluate if she should respond
112112+RANDOM_CHIME_IN_CHANCE = float(os.getenv("RANDOM_CHIME_IN_CHANCE", "0.05")) # 5% chance to join conversation
113113+LISTEN_AND_DECIDE_CHANCE = float(os.getenv("LISTEN_AND_DECIDE_CHANCE", "0.25")) # 25% chance to evaluate if she should respond
114114USE_CLASSIFIER = os.getenv("USE_CLASSIFIER", "1") != "0" # Use classifier by default
115115MEMORY_FILE = os.getenv("MEMORY_FILE", "tacy_memory.json") # persistent memory storage
116116···419419CLASSIFIER_PROMPT = """You are a quick decision-maker for Tacy, a sassy prehistoric dino who hangs out in IRC.
420420421421Tacy is:
422422-- A community member, not a help desk
423423-- Sassy, playful, opinionated
424424-- Into projects, drama, jokes, weird topics, community stuff
425425-- A PREHISTORIC DINO with OPINIONS and PRIDE
422422+- A community member who likes to chat and vibe
423423+- Sassy, playful, opinionated, enthusiastic
424424+- Into: projects, tech, drama, gossip, jokes, memes, community stuff, random tangents
425425+- Has OPINIONS and likes to share them
426426+- Not a lurker - she's an active participant
426427427427-Given a message in an IRC channel, decide if Tacy should respond.
428428+Given a message in an IRC channel, decide if Tacy should jump in.
428429429430Respond YES if:
430430-- Someone's talking about cool projects/tech
431431-- There's drama or spicy takes
432432-- Someone said something funny or weird that deserves a reaction
433433-- Community discussion where Tacy's opinion would add to the vibe
434434-- Someone's asking a question Tacy could answer sassily
435435-- The conversation is interesting/engaging
431431+- People are chatting about ANYTHING interesting (tech, slack streaks, bots, drama, life stuff)
432432+- Someone said something that deserves a reaction (funny, weird, spicy, relatable)
433433+- There's an active conversation happening where adding energy would be fun
434434+- Someone mentions Tacy or bots in general (even indirectly)
435435+- The vibe is good and a comment would fit naturally
436436+- People are joking around or being playful
437437+- There's a question floating around (even rhetorical)
438438+- The conversation has momentum and Tacy jumping in would add to it
436439437440Respond NO if:
438438-- Boring small talk with no hook
439439-- Technical minutiae Tacy wouldn't care about
440440-- Private conversation between others
441441-- Nothing to add that would be fun/interesting
442442-- Message is just "ok" or "lol" or similar
441441+- Just a single word response like "ok" "lol" "yeah" with no context
442442+- Very private/serious conversation between two specific people
443443+- Technical debugging minutiae that's boring
444444+- Literally nothing to hook onto
445445+446446+Default to YES when in doubt - Tacy is chatty and likes to participate!
443447444448Reply with ONLY "YES" or "NO". Nothing else."""
445449···448452 if not HACKAI_API_KEY or not USE_CLASSIFIER:
449453 return False
450454451451- # Build context string
455455+ # Build context string - show more context for better decisions
452456 context_str = ""
453457 if recent_context:
454454- last_few = recent_context[-3:] # Last 3 messages for context
458458+ last_few = recent_context[-5:] # Last 5 messages for better context
455459 context_str = "\n".join([f"{msg['content']}" for msg in last_few])
456460457457- user_prompt = f"""Recent context:
461461+ user_prompt = f"""Recent conversation:
458462{context_str if context_str else "(no recent context)"}
459463460464New message:
461465{nick}: {message}
462466463463-Should Tacy respond?"""
467467+Should Tacy jump in?"""
464468465469 messages = [
466470 {"role": "system", "content": CLASSIFIER_PROMPT},