Skip to content

feat(ai): opt-in LangGraph product assistant backend - #29

Merged
gianlucamazza merged 1 commit into
mainfrom
feature/langgraph-product-opt-in
Aug 7, 2026
Merged

feat(ai): opt-in LangGraph product assistant backend#29
gianlucamazza merged 1 commit into
mainfrom
feature/langgraph-product-opt-in

Conversation

@gianlucamazza

Copy link
Copy Markdown
Owner

Summary

Opt-in LangGraph product path behind the existing AssistantRuntime facade. Default remains chat (chat_agent_tool_loop). No new public CLI commands.

  • assistant_backend setting / ASSISTANT_BACKEND=chat|langgraph
  • GraphAssistantBackend: model↔tools StateGraph, ReAct when provider lacks native tools, plain generate otherwise
  • Shared prompt helpers (ai.runtime.prompt) used by chat + langgraph
  • Node-granularity StreamEvent streaming on the graph path
  • Status exposes assistant_backend + assistant_backend_id
  • Populates context.available_tools so native tool loops actually engage
  • build_assistant_graph never re-enters runtime.run
  • Typed contracts (BaseLLMProvider, Protocol); no cast / type: ignore / noqa

Non-goals (this PR)

  • Default flip to langgraph (later, after soak)
  • Multi-agent workflows on CLI
  • Token-level streaming inside graph model node (v1 is node-granularity)

Test plan

  • ruff check + mypy openfatture/ai/runtime
  • Parity suite: tests/ai/test_assistant_backend_parity.py
  • Runtime / tool-loop / status readiness tests
  • CI green on this PR
  • Manual (optional): ASSISTANT_BACKEND=langgraph openfatture assistant "…"

Add assistant_backend=chat|langgraph (default chat) behind the existing
AssistantRuntime facade. LangGraph path uses GraphAssistantBackend with
shared prompt helpers, ReAct fallback for non-tool providers, and
node-granularity StreamEvent streaming.

- Settings ASSISTANT_BACKEND + status assistant_backend(_id)
- Populate available_tools so native tool loops actually engage
- build_assistant_graph no longer re-enters runtime.run
- Parity tests for tool round-trips, max iterations, stream order, sessions
- Typed interfaces (BaseLLMProvider, Protocol); no cast/type:ignore/noqa
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@gianlucamazza, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 38 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: be8ae161-26fe-497c-b7de-dbd7160df6d1

📥 Commits

Reviewing files that changed from the base of the PR and between a99e113 and 8f55daa.

📒 Files selected for processing (16)
  • CHANGELOG.md
  • docs/AI_ARCHITECTURE.md
  • docs/CONFIGURATION.md
  • docs/STATUS.md
  • openfatture/ai/agents/chat_agent.py
  • openfatture/ai/runtime/__init__.py
  • openfatture/ai/runtime/constants.py
  • openfatture/ai/runtime/graph.py
  • openfatture/ai/runtime/graph_backend.py
  • openfatture/ai/runtime/prompt.py
  • openfatture/ai/runtime/service.py
  • openfatture/cli/commands/status.py
  • openfatture/platform/config.py
  • tests/ai/test_assistant_backend_parity.py
  • tests/ai/test_assistant_runtime.py
  • tests/ai/test_tool_loop_parity.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

Performance Test Results

Benchmark results file is empty (no benchmarks collected)


View detailed results in the workflow artifacts

@gianlucamazza
gianlucamazza merged commit ee019bd into main Aug 7, 2026
12 checks passed
@gianlucamazza
gianlucamazza deleted the feature/langgraph-product-opt-in branch August 7, 2026 23:32
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