Skip to content

feat(gooddata-eval): support requesting a per-message reasoning effort - #1704

Open
Tomkess wants to merge 2 commits into
masterfrom
feat/chat-client-reasoning-effort
Open

feat(gooddata-eval): support requesting a per-message reasoning effort#1704
Tomkess wants to merge 2 commits into
masterfrom
feat/chat-client-reasoning-effort

Conversation

@Tomkess

@Tomkess Tomkess commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

GoodData Cloud's chat-conversations endpoint (POST /api/v1/ai/workspaces/{workspaceId}/chat/conversations/{conversationId}/messages) has an experimental options.reasoningEffort field (LOW/MEDIUM/HIGH) that hints how much the LLM should reason before answering. gooddata-eval had no way to set it.

This PR adds a --reasoning-effort flag (and GD_EVAL_REASONING_EFFORT env var) that threads the value through every message gd-eval sends.

  • ChatClient.send_message/ask gain reasoning_effort: str | None, sent as {"options": {"reasoningEffort": value}} when set, omitted entirely otherwise.
  • All 7 agentic evaluators (metric_skill, alert_skill, visualization, search_tool, general_question, guardrail, conversation) gain the same parameter, threaded to every send_message call — including every turn of multi-turn confirm-loops.
  • CLI dispatcher (_dispatch_agentic/run_agentic_items), RunConfig, and the non-agentic _RoutingBackend path are wired up.
  • README documents the flag and its most important caveat.

Key difference from agentId (already supported): agentId is set once at conversation creation and persists for the whole conversation. reasoningEffort is not persisted — it applies only to the message it's sent with, and every other message silently falls back to MEDIUM. So it has to be threaded as a per-send_message parameter, not a ChatClient constructor parameter, and every call site in every multi-turn loop needs it.

Also gated behind an org-level GoodData feature flag — when disabled, any value sent is ignored and MEDIUM is used.

Test plan

  • New unit tests for ChatClient.send_message (omit-by-default / send-when-given) in test_sse_client.py
  • New parametrized test covering all 7 agentic dispatch kinds forward reasoning_effort correctly (test_agentic_runner.py, new file)
  • New CLI tests: flag parsing, env var fallback, flag-wins-over-env, invalid-value rejection (test_cli.py)
  • Updated 3 existing test_agentic_visualization.py assertions that asserted exact send_message call args
  • Full suite: pytest -q → 258 passed, 9 pre-existing failures (8 missing openai package, 1 unrelated pre-existing bug in test_runner.py), no regressions
  • ruff format --check . and ruff check . (pinned 0.15.20) both clean across the whole repo

Summary by CodeRabbit

  • New Features

    • Added configurable AI reasoning effort levels: Low, Medium, or High.
    • Added command-line and environment-variable configuration, with command-line settings taking precedence.
    • Applied reasoning effort to agentic evaluations and routed chat requests.
  • Documentation

    • Documented supported settings, configuration behavior, feature gating, and provider-specific handling.
  • Tests

    • Added coverage for configuration, validation, precedence, and request handling.

GoodData Cloud's chat-conversations endpoint accepts an experimental
options.reasoningEffort (LOW/MEDIUM/HIGH) on each POST .../messages call.
Thread it through ChatClient.send_message/ask, all 7 agentic evaluators,
the CLI dispatcher, and RunConfig, exposed as --reasoning-effort /
GD_EVAL_REASONING_EFFORT. Not persisted server-side, so every message the
client sends must carry it (unlike agentId, which is set once at
conversation creation).
@Tomkess
Tomkess requested review from hkad98, lupko and pcerny as code owners August 4, 2026 08:30
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

Next review available in: 51 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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 00891378-20b1-4801-8159-d9327c01f90e

📥 Commits

Reviewing files that changed from the base of the PR and between e26263c and 7fdb470.

📒 Files selected for processing (2)
  • packages/gooddata-eval/src/gooddata_eval/cli/main.py
  • packages/gooddata-eval/tests/test_cli.py
📝 Walkthrough

Walkthrough

The evaluation CLI adds --reasoning-effort and GD_EVAL_REASONING_EFFORT. The selected value is stored in RunConfig, propagated through agentic evaluators and routed chat requests, and serialized as options.reasoningEffort.

Changes

Reasoning effort support

Layer / File(s) Summary
CLI and run configuration
packages/gooddata-eval/src/gooddata_eval/cli/main.py, packages/gooddata-eval/src/gooddata_eval/core/config.py
The CLI accepts LOW, MEDIUM, or HIGH. The CLI value takes precedence over the environment value.
Chat request serialization
packages/gooddata-eval/src/gooddata_eval/core/chat/sse_client.py, packages/gooddata-eval/tests/test_sse_client.py
ChatClient forwards reasoning effort and includes it in options.reasoningEffort when provided.
Agentic evaluator propagation
packages/gooddata-eval/src/gooddata_eval/cli/agentic_runner.py, packages/gooddata-eval/src/gooddata_eval/core/agentic/*
All supported agentic evaluation paths forward reasoning effort to initial and follow-up messages.
Validation and documentation
packages/gooddata-eval/tests/test_cli.py, packages/gooddata-eval/tests/test_agentic_runner.py, packages/gooddata-eval/tests/test_agentic_visualization.py, packages/gooddata-eval/README.md
Tests cover forwarding, defaults, precedence, invalid values, and request serialization. The README documents the setting.
Estimated code review effort: 3 (Moderate) ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CLI
  participant RunConfig
  participant AgenticRunner
  participant AgenticEvaluator
  participant ChatClient
  CLI->>RunConfig: Resolve reasoning effort
  RunConfig->>AgenticRunner: Pass configured value
  AgenticRunner->>AgenticEvaluator: Dispatch evaluation
  AgenticEvaluator->>ChatClient: Send messages with reasoning effort
Loading

Suggested reviewers: lupko, pcerny, hkad98

Poem

A rabbit tunes the thinking dial,
LOW or HIGH for every trial.
Through chats and runs the setting hops,
While tests guard all the message stops.
Documentation marks the trail.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 52.08% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the addition of per-message reasoning effort support in gooddata-eval.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/gooddata-eval/README.md`:
- Around line 114-121: Update the Markdown example around the “One-off, via
flag” and “Session-wide, via env var” commands to use the repository’s
configured indented code-block style instead of fenced syntax. Preserve the
commands and their explanatory comments unchanged.

In `@packages/gooddata-eval/src/gooddata_eval/cli/main.py`:
- Line 451: Validate the value selected for reasoning_effort in the CLI
argument/configuration flow before passing it to ChatClient, applying the same
LOW/MEDIUM/HIGH constraint used for --reasoning-effort to values from
GD_EVAL_REASONING_EFFORT as well. Add a test covering an invalid environment
value and verify it is rejected.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f3af03b7-cefc-412e-9aff-9e79eb28f955

📥 Commits

Reviewing files that changed from the base of the PR and between acfcc1a and e26263c.

📒 Files selected for processing (16)
  • packages/gooddata-eval/README.md
  • packages/gooddata-eval/src/gooddata_eval/cli/agentic_runner.py
  • packages/gooddata-eval/src/gooddata_eval/cli/main.py
  • packages/gooddata-eval/src/gooddata_eval/core/agentic/alert_skill.py
  • packages/gooddata-eval/src/gooddata_eval/core/agentic/conversation.py
  • packages/gooddata-eval/src/gooddata_eval/core/agentic/general_question.py
  • packages/gooddata-eval/src/gooddata_eval/core/agentic/guardrail.py
  • packages/gooddata-eval/src/gooddata_eval/core/agentic/metric_skill.py
  • packages/gooddata-eval/src/gooddata_eval/core/agentic/search_tool.py
  • packages/gooddata-eval/src/gooddata_eval/core/agentic/visualization.py
  • packages/gooddata-eval/src/gooddata_eval/core/chat/sse_client.py
  • packages/gooddata-eval/src/gooddata_eval/core/config.py
  • packages/gooddata-eval/tests/test_agentic_runner.py
  • packages/gooddata-eval/tests/test_agentic_visualization.py
  • packages/gooddata-eval/tests/test_cli.py
  • packages/gooddata-eval/tests/test_sse_client.py

Comment thread packages/gooddata-eval/README.md
Comment thread packages/gooddata-eval/src/gooddata_eval/cli/main.py Outdated
@codecov

codecov Bot commented Aug 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.93939% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.46%. Comparing base (acfcc1a) to head (7fdb470).

Files with missing lines Patch % Lines
...ddata-eval/src/gooddata_eval/cli/agentic_runner.py 0.00% 1 Missing ⚠️
...ckages/gooddata-eval/src/gooddata_eval/cli/main.py 91.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1704      +/-   ##
==========================================
+ Coverage   78.30%   78.46%   +0.16%     
==========================================
  Files         271      271              
  Lines       18689    18702      +13     
==========================================
+ Hits        14634    14675      +41     
+ Misses       4055     4027      -28     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…easoning-effort

The argparse choices constraint only covered the CLI flag; an invalid
env var value slipped straight through to ChatClient/the API. Reject
it in main() before building RunConfig.

Addresses CodeRabbit review comment on PR #1704.
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