Fix mail read auto-ack and add Mayor startup directive

- Remove auto-ack on mail read so handoff messages persist
- Add STARTUP PROTOCOL directive for Mayor and Polecat roles
- Agents now get explicit instructions to check in on startup

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-12-19 22:37:45 -08:00
parent 7978b395cd
commit 71d313ed60
3 changed files with 31 additions and 3 deletions

View File

@@ -373,8 +373,9 @@ func runMailRead(cmd *cobra.Command, args []string) error {
return fmt.Errorf("getting message: %w", err)
}
// Mark as read
_ = mailbox.MarkRead(msgID)
// Note: We intentionally do NOT mark as read/ack on read.
// User must explicitly delete/ack the message.
// This preserves handoff messages for reference.
// JSON output
if mailReadJSON {

View File

@@ -88,6 +88,9 @@ func runPrime(cmd *cobra.Command, args []string) error {
// Run gt mail check --inject to inject any pending mail
runMailCheckInject(cwd)
// Output startup directive for roles that should announce themselves
outputStartupDirective(ctx)
return nil
}
@@ -385,6 +388,30 @@ func runBdPrime(workDir string) {
}
}
// outputStartupDirective outputs role-specific instructions for the agent.
// This tells agents like Mayor to announce themselves on startup.
func outputStartupDirective(ctx RoleContext) {
switch ctx.Role {
case RoleMayor:
fmt.Println()
fmt.Println("---")
fmt.Println()
fmt.Println("**STARTUP PROTOCOL**: You are the Mayor. Please:")
fmt.Println("1. Announce: \"Mayor, checking in.\"")
fmt.Println("2. Check mail: `gt mail inbox`")
fmt.Println("3. If there's a 🤝 HANDOFF message, read it and summarize")
fmt.Println("4. If no mail, await user instruction")
case RolePolecat:
fmt.Println()
fmt.Println("---")
fmt.Println()
fmt.Println("**STARTUP PROTOCOL**: You are a polecat. Please:")
fmt.Println("1. Check mail: `gt mail inbox`")
fmt.Println("2. If assigned work, begin immediately")
fmt.Println("3. If no work, announce ready and await assignment")
}
}
// runMailCheckInject runs `gt mail check --inject` and outputs the result.
// This injects any pending mail into the agent's context.
func runMailCheckInject(workDir string) {