Skip to content

fix(cat): forget verb works in BOTH dispatch systems and clears BOTH stores - #545

Merged
catomean merged 1 commit into
mainfrom
fix/forget-action-both-stores
Aug 2, 2026
Merged

fix(cat): forget verb works in BOTH dispatch systems and clears BOTH stores#545
catomean merged 1 commit into
mainfrom
fix/forget-action-both-stores

Conversation

@catomean

@catomean catomean commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

Live-test findings on #542

Testing 'forget my photography/French/ceramics/weekend memories' against prod:

  • Tool call fired, but the model used the exec_action form → CAT_ACTIONS (the second dispatch system) didn't know the verb → chip: '× forget_memories failed: Unknown action'.
  • The model still wrote 'I've forgotten those details' — exec_action text is composed before the action runs.
  • The wrong facts also live in the economic profile, which only had additive writes (merge-union; can never shrink).

Fixes

  • forget_memories registered in CAT_ACTIONS (context / low-risk / no confirmation) with a handler.
  • Handler clears both stores in one call: forgetMemoriesMatching + new removeFromEconomicProfile (direct overwrite with matching entries filtered from skills/assets/goals/constraints/askedFor) — reports exactly {deleted, removed, notFound}.
  • Prompt rule: announce exec_actions as in progress, never as done — the result chip is the truth.

Verify

tsc clean · eslint clean · 31 unit tests green (3 new profile-removal cases) · will re-run the live browser test post-deploy.

🤖 Generated with Claude Code

…stores

Live test of #542 exposed two more layers of the same bug class:

1. Cat has TWO dispatch systems — the tool-call loop (where #542
   registered forget_memories) and the exec_action registry
   (CAT_ACTIONS → action-executor). The free model emitted the
   exec_action form, hit the registry that didn't know the verb, and the
   chip showed 'Unknown action: forget_memories'. The verb is now
   registered there too (context category, low risk, no confirmation),
   with a handler.
2. The wrong facts ALSO live in the structured economic profile, which
   only had additive writes (saveEconomicProfile merge-unions — it can
   never shrink). New removeFromEconomicProfile() overwrites the row
   with matching entries filtered out of every dimension. The handler
   clears memories AND profile in one call and reports exactly what each
   removed.
3. exec_action text is written BEFORE the action runs, so the model
   claimed 'I've forgotten those details' next to a failure chip. New
   prompt rule: announce actions as in progress, never as done — the
   result chip is the truth.

Verified: tsc clean, eslint clean (1 pre-existing warning), 31 unit
tests green incl. 3 new profile-removal cases.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@catomean
catomean merged commit bad0e72 into main Aug 2, 2026
5 checks passed
@catomean
catomean deleted the fix/forget-action-both-stores branch August 2, 2026 11:47
catomean added a commit that referenced this pull request Aug 2, 2026
…th too (#562)

#545 registered forget_memories in both dispatch systems and promised it
"clears BOTH stores" — but the both-stores composition landed only in the
exec_action handler. The tool-call path (the default for tool-capable
providers) called forgetMemoriesMatching alone, so a "removed" skill kept
living in user_economic_profile and kept driving offers/interview prompts:
the exact half-forgotten failure the fix was written to end, surviving on
the other dispatch path.

The tool-call branch now runs forgetMemoriesMatching AND
removeFromEconomicProfile in parallel (mirroring handlers/context.ts),
reports both result sets in the tool content, only lists a fact as notFound
when BOTH stores missed it, and counts profile-only removals as success
instead of no_results.

Deliberately touches only tool-executor.ts + a new test — no overlap with
the open #555 matcher rework (memory.ts / context.ts), which carries the
shared-matcher refactor blockers separately.

New suite pins the both-stores contract on this path: union reporting,
profile-only success, and both-missed no_results. 428 cat-area tests green.

Co-authored-by: Georgy Butaev <41178744+g-but@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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