@@ -52,11 +52,11 @@ type Agent struct {
5252 // even after the operator explicitly chose chatbot/customize.
5353 // PromptMode also drives the per-turn tool filter via
5454 // builtinAllowForMode below.
55- promptMode string
56- homePath string // agent's home: SOUL.md, sessions, memory, skills
57- workspacePath string // working dir where agent creates user files
58- homeDir string // FastClaw root, ~/.fastclaw
59- ownerUserID string // the user that owns this agent (for hook namespacing)
55+ promptMode string
56+ homePath string // agent's home: SOUL.md, sessions, memory, skills
57+ workspacePath string // working dir where agent creates user files
58+ homeDir string // FastClaw root, ~/.fastclaw
59+ ownerUserID string // the user that owns this agent (for hook namespacing)
6060 // admins is the per-channel allowlist of chatters who can run write-
6161 // mode slash commands (/new /undo /retry /compact /model /personality).
6262 // Keyed by channel name (e.g. "discord" → ["123...", "456..."]). Empty
@@ -339,15 +339,15 @@ func NewAgentWithSkillsCfg(rc config.ResolvedAgent, prov provider.Provider, mb *
339339 maxParallelToolCalls : rc .MaxParallelToolCalls ,
340340 thinking : rc .Thinking ,
341341 promptMode : rc .PromptMode ,
342- homePath : rc .Home ,
343- workspacePath : workspace ,
344- homeDir : homeDir ,
345- admins : rc .Admins ,
346- skillsCfg : rc .Skills ,
347- globalSkillsCfg : globalSkillsCfg ,
348- messageBus : mb ,
349- engine : eng ,
350- costTracker : eng .costTracker ,
342+ homePath : rc .Home ,
343+ workspacePath : workspace ,
344+ homeDir : homeDir ,
345+ admins : rc .Admins ,
346+ skillsCfg : rc .Skills ,
347+ globalSkillsCfg : globalSkillsCfg ,
348+ messageBus : mb ,
349+ engine : eng ,
350+ costTracker : eng .costTracker ,
351351 }
352352
353353 // Multi-bubble split-replies: per-agent only — system-level toggle
@@ -1702,7 +1702,7 @@ func (a *Agent) handlePlanMode(ctx context.Context, msg bus.InboundMessage) stri
17021702 if catalog != "" {
17031703 messages = append (messages , provider.Message {Role : "system" , Content : catalog })
17041704 }
1705- messages = append (messages , a .withMessageTimestamps (sess .GetMessages ())... )
1705+ messages = append (messages , a .withMessageTimestampsForChatter (sess .GetMessages (), chatterUID )... )
17061706 if a .piiScrubEnabled {
17071707 messages = privacy .ScrubMessages (messages )
17081708 }
@@ -1953,7 +1953,7 @@ func (a *Agent) HandleMessage(ctx context.Context, msg bus.InboundMessage) strin
19531953 if reminder := renderChatbotPersistenceReminder (a .promptMode , a .displayName , chatterMem .LoadUserFile (), chatterMem .LoadMemory ()); reminder != "" {
19541954 messages = append (messages , provider.Message {Role : "system" , Content : reminder })
19551955 }
1956- messages = append (messages , a .withMessageTimestamps (sessionMsgs )... )
1956+ messages = append (messages , a .withMessageTimestampsForChatter (sessionMsgs , chatterUID )... )
19571957
19581958 toolDefs := a .registry .DefinitionsForMode (builtinAllowForMode (a .promptMode ))
19591959
@@ -2659,7 +2659,7 @@ func (a *Agent) HandleMessageStream(ctx context.Context, msg bus.InboundMessage)
26592659 if reminder := renderChatbotPersistenceReminder (a .promptMode , a .displayName , chatterMem .LoadUserFile (), chatterMem .LoadMemory ()); reminder != "" {
26602660 messages = append (messages , provider.Message {Role : "system" , Content : reminder })
26612661 }
2662- messages = append (messages , a .withMessageTimestamps (sessionMsgs )... )
2662+ messages = append (messages , a .withMessageTimestampsForChatter (sessionMsgs , chatterUID )... )
26632663
26642664 toolDefs := a .registry .DefinitionsForMode (builtinAllowForMode (a .promptMode ))
26652665
@@ -3026,20 +3026,20 @@ func (a *Agent) RegisteredTools() []tools.ToolInfo {
30263026// support / role-play products:
30273027//
30283028// - image_gen : self-generated images (registered only if a
3029- // provider is configured; absence is fine)
3029+ // provider is configured; absence is fine)
30303030// - tts : voice messages (same conditional registration)
30313031// - write_file : persist USER.md / MEMORY.md when the LLM learns
3032- // something worth keeping. Routing in
3033- // systemFileUserID sends USER.md/MEMORY.md to the
3034- // per-chatter row, so each chatter accrues their
3035- // own profile / memory. Path resolution rejects
3036- // arbitrary paths via identityFileBlocked +
3037- // workspace scoping, so this isn't a general
3038- // "let the chatbot write anywhere" hole — just
3039- // the canonical per-chatter notes.
3032+ // something worth keeping. Routing in
3033+ // systemFileUserID sends USER.md/MEMORY.md to the
3034+ // per-chatter row, so each chatter accrues their
3035+ // own profile / memory. Path resolution rejects
3036+ // arbitrary paths via identityFileBlocked +
3037+ // workspace scoping, so this isn't a general
3038+ // "let the chatbot write anywhere" hole — just
3039+ // the canonical per-chatter notes.
30403040// - edit_file : same rationale; preferred over write_file when
3041- // surgically updating MEMORY.md so the model
3042- // doesn't accidentally clobber prior entries.
3041+ // surgically updating MEMORY.md so the model
3042+ // doesn't accidentally clobber prior entries.
30433043//
30443044// Notably absent: `read_file` / `list_dir` — chatbot mode shouldn't
30453045// browse the filesystem; USER.md / MEMORY.md content is already loaded
@@ -3145,11 +3145,11 @@ func (a *Agent) chatterLocation(chatterUID string) *time.Location {
31453145// a read-time view for the LLM, not stored history), so the session store
31463146// stays clean and the next turn doesn't double-prefix. The system prompt
31473147// (context.go dateLine) tells the model what the bracketed prefix means.
3148- func (a * Agent ) withMessageTimestamps (msgs []provider.Message ) []provider.Message {
3148+ func (a * Agent ) withMessageTimestampsForChatter (msgs []provider.Message , chatterUID string ) []provider.Message {
31493149 if len (msgs ) == 0 {
31503150 return msgs
31513151 }
3152- loc := a .chatterLocation (a . registry . ChatterUserID () )
3152+ loc := a .chatterLocation (chatterUID )
31533153 out := make ([]provider.Message , len (msgs ))
31543154 for i , m := range msgs {
31553155 if m .Role == "user" && m .Timestamp > 0 && m .Content != "" {
0 commit comments