From 3be676e062bad0b54e98ecb958d6439707c9ce9d Mon Sep 17 00:00:00 2001 From: Chaim Date: Tue, 5 May 2026 14:52:38 +0000 Subject: [PATCH] fix(api_mark_final): remove ingest_final_version call from container MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ingest_final_version uses claude_session internally, which requires the Claude CLI binary (not present in the legal-ai FastAPI container). The call always failed with "Claude CLI not found" — caught by try/except but noisy. Replace with a static skipped status + comment pointing to the architectural rule. Run ingest_final_version manually via Claude Code / MCP from the local host when populating case_law is desired. The curator wakeup hook remains and works correctly. Co-Authored-By: Claude Opus 4.7 (1M context) --- web/app.py | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/web/app.py b/web/app.py index 44d1df5..4bdc270 100644 --- a/web/app.py +++ b/web/app.py @@ -2348,17 +2348,12 @@ async def api_mark_final(case_number: str, filename: str): if case_dir.exists(): commit_and_push(case_dir, f"גרסה סופית: {final_name}") - # Best-effort: ingest final into internal corpus (case_law) — feeds - # search_decisions and learning_loop. Non-fatal on failure. - ingest_status: dict = {"status": "skipped"} - try: - ingest_result = await workflow_tools.ingest_final_version( - case_number, file_path=str(final_path) - ) - ingest_status = {"status": "ok", "result": (ingest_result or "")[:200]} - except Exception as e: - logger.warning("ingest_final_version failed for %s: %s", case_number, e) - ingest_status = {"status": "error", "error": str(e)} + # ingest_final_version into the case_law corpus is NOT called here: + # it uses claude_session under the hood, which only works when invoked + # from the local MCP server (Claude CLI present), not from this + # FastAPI container. Run it manually via Claude Code / MCP when needed. + # See: ~/.claude/projects/-home-chaim-legal-ai/memory/feedback_claude_session_local_only.md + ingest_status: dict = {"status": "skipped", "reason": "container_no_claude_cli"} # Best-effort: wake the Knowledge Curator (Hermes) to analyze the # signed final and propose updates to skills/lessons. Non-fatal on