fix(memory): unify Outcome enum and add ABANDONED support
- Add ABANDONED value to core Outcome enum in types.py - Replace duplicate OutcomeType class in mcp/tools.py with alias to Outcome - Simplify mcp/service.py to use outcome directly (no more silent mapping) - Add migration 0006 to extend PostgreSQL episode_outcome enum - Add missing constraints to migration 0005 (ix_facts_unique_triple_global) This fixes the semantic issue where ABANDONED outcomes were silently converted to FAILURE, losing information about task abandonment. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1024,15 +1024,8 @@ class MemoryToolService:
|
||||
context: ToolContext,
|
||||
) -> dict[str, Any]:
|
||||
"""Execute the 'record_outcome' tool."""
|
||||
# Map outcome type to memory Outcome
|
||||
# Note: ABANDONED maps to FAILURE since core Outcome doesn't have ABANDONED
|
||||
outcome_map = {
|
||||
OutcomeType.SUCCESS: Outcome.SUCCESS,
|
||||
OutcomeType.PARTIAL: Outcome.PARTIAL,
|
||||
OutcomeType.FAILURE: Outcome.FAILURE,
|
||||
OutcomeType.ABANDONED: Outcome.FAILURE, # No ABANDONED in core enum
|
||||
}
|
||||
outcome = outcome_map.get(args.outcome, Outcome.FAILURE)
|
||||
# OutcomeType is now an alias for Outcome, use directly
|
||||
outcome = args.outcome
|
||||
|
||||
# Record in episodic memory
|
||||
episodic = await self._get_episodic()
|
||||
|
||||
Reference in New Issue
Block a user