Skip to content

Document behavior_controls API parameter for prompt customization - #1743

Merged
aantn merged 4 commits into
masterfrom
claude/document-http-api-fast-mode-4MkWg
Mar 12, 2026
Merged

aantn merged 4 commits into
masterfrom
claude/document-http-api-fast-mode-4MkWg

Conversation

@aantn

@aantn aantn commented Mar 11, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Added comprehensive documentation for the behavior_controls API parameter, which allows fine-grained control over which prompt sections HolmesGPT includes in requests. This feature provides an API equivalent to the CLI's --fast-mode flag.

Key Changes

  • Added behavior_controls parameter to the HTTP API reference documentation
  • Created new "Fast Mode & Prompt Controls" section with:
    • Complete table of 13 available prompt section keys (system and user prompts)
    • Descriptions of each section's purpose
    • Two practical examples:
      • Fast mode example: disabling TodoWrite planning for quicker responses
      • Minimal prompt example: reducing token usage and latency
    • Clear precedence rules explaining interaction between ENABLED_PROMPTS env var, behavior_controls parameter, and defaults
    • Format specification for the ENABLED_PROMPTS environment variable

Notable Details

  • Documentation clarifies the three-level precedence hierarchy: env var (highest) → API parameter → defaults (lowest)
  • Includes curl examples showing real-world usage patterns
  • Explains that the server-side ENABLED_PROMPTS env var acts as a security boundary that cannot be overridden by client requests

https://claude.ai/code/session_0188ZPUZhVzED8bjKuZ3zVSo

Summary by CodeRabbit

  • New Features

    • Added a behavior_controls parameter to chat requests to selectively enable/disable prompt sections.
    • Certain prompt sections are now disabled by default and can be explicitly enabled via overrides.
  • Documentation

    • New "Fast Mode & Prompt Controls" section with usage examples and precedence rules.
    • Updated Structured Output guidance to describe behavior_controls effects on prompt composition.

Add documentation for the behavior_controls field on /api/chat,
which allows API consumers to selectively enable/disable prompt
sections. Includes the full list of available section keys, fast
mode and minimal prompt examples, and precedence rules for the
ENABLED_PROMPTS env var.

https://claude.ai/code/session_0188ZPUZhVzED8bjKuZ3zVSo
Signed-off-by: Claude <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Mar 11, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4cb78f0a-b2b3-45c0-aea0-0dcc3d92ed6f

📥 Commits

Reviewing files that changed from the base of the PR and between 4908a59 and 9733591.

📒 Files selected for processing (3)
  • docs/reference/http-api.md
  • holmes/core/prompt.py
  • tests/core/test_prompt.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/reference/http-api.md

Walkthrough

Adds a new request-level prompt override mechanism (behavior_controls) in the HTTP API docs and implements defaults and override logic in prompt handling (new DISABLED_BY_DEFAULT); also adds tests validating disabled-by-default behavior and explicit overrides.

Changes

Cohort / File(s) Summary
API Documentation
docs/reference/http-api.md
Add behavior_controls field to /api/chat docs, new "Fast Mode & Prompt Controls" section with mappings, precedence rules (ENABLED_PROMPTS vs behavior_controls vs defaults), examples, and reference in Structured Output discussion.
Prompt core logic
holmes/core/prompt.py
Introduce DISABLED_BY_DEFAULT = {PromptComponent.AI_SAFETY} and adjust is_component_enabled semantics; modify InvalidImageDictError to accept and store provided_keys in its constructor.
Tests
tests/core/test_prompt.py
Add tests verifying components marked disabled-by-default (AI_SAFETY) are off by default and can be enabled via overrides.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant Client
    participant API as Chat API
    participant PromptBuilder
    participant Model

    Client->>API: POST /api/chat with messages + behavior_controls
    API->>PromptBuilder: build prompt (messages, env ENABLED_PROMPTS, behavior_controls)
    PromptBuilder->>PromptBuilder: resolve enabled components (DISABLED_BY_DEFAULT, ENABLED_PROMPTS, behavior_controls)
    PromptBuilder->>Model: send composed prompt
    Model-->>API: response
    API-->>Client: return response
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • moshemorad
  • RoiGlinik
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: documenting a new behavior_controls API parameter for prompt customization, which aligns with the core objective of adding API documentation for this feature.
Docstring Coverage ✅ Passed Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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 and usage tips.

@netlify

netlify Bot commented Mar 11, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for holmes-docs ready!

Name Link
🔨 Latest commit cc48939
🔍 Latest deploy log https://app.netlify.com/projects/holmes-docs/deploys/69b26ca2b95ed90008f2410a
😎 Deploy Preview https://deploy-preview-1743--holmes-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
docs/reference/http-api.md (1)

61-61: Clarify the exact behavior_controls contract in the field table.

behavior_controls is documented as a generic object, but the actual API shape is Dict[str, bool]. It would help to spell out that this is a section-key → boolean map, and that unknown keys are ignored rather than rejected.

✏️ Suggested doc tweak
-| behavior_controls       | No       |         | object    | Override prompt sections to enable/disable them (see [Fast Mode & Prompt Controls](`#fast-mode--prompt-controls`)) |
+| behavior_controls       | No       |         | object    | Map of section keys to booleans, used to enable/disable prompt sections. Unknown keys are ignored. See [Fast Mode & Prompt Controls](`#fast-mode--prompt-controls`) |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/reference/http-api.md` at line 61, The docs currently list
behavior_controls as a generic object; update the field description for
behavior_controls to state its precise contract: it is a map/dictionary of
section-key (string) → boolean (Dict[str, bool]) used to enable/disable prompt
sections, and unknown keys are ignored (not rejected) by the API. Be concise and
replace "object" with this explicit shape and behavior in the table entry for
behavior_controls.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@docs/reference/http-api.md`:
- Line 61: The docs currently list behavior_controls as a generic object; update
the field description for behavior_controls to state its precise contract: it is
a map/dictionary of section-key (string) → boolean (Dict[str, bool]) used to
enable/disable prompt sections, and unknown keys are ignored (not rejected) by
the API. Be concise and replace "object" with this explicit shape and behavior
in the table entry for behavior_controls.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 23c42897-970b-4db9-9569-1d2e29836820

📥 Commits

Reviewing files that changed from the base of the PR and between f0aa88c and 4908a59.

📒 Files selected for processing (1)
  • docs/reference/http-api.md

claude added 2 commits March 12, 2026 07:28
Put practical examples (fast mode, minimal prompt, precedence rules)
first so users see actionable content before the full reference table.

https://claude.ai/code/session_0188ZPUZhVzED8bjKuZ3zVSo
Signed-off-by: Claude <noreply@anthropic.com>
Add DISABLED_BY_DEFAULT set in prompt.py so that ai_safety is off
unless explicitly enabled via behavior_controls or ENABLED_PROMPTS
env var. Update docs and add tests for the new default behavior.

https://claude.ai/code/session_0188ZPUZhVzED8bjKuZ3zVSo
Signed-off-by: Claude <noreply@anthropic.com>
@github-actions

github-actions Bot commented Mar 12, 2026 •

Copy link
Copy Markdown
Contributor

📂 Previous Runs

📜 Run @ 9733591 (#22991250500)

✅ Results of HolmesGPT evals

Automatically triggered by commit 9733591 on branch claude/document-http-api-fast-mode-4MkWg

View workflow logs

Results of HolmesGPT evals

  • ask_holmes: 10/10 test cases were successful, 0 regressions
Status Test case Time Turns Tools Cost Total tokens Input Output Cached Non-cached Reasoning Max output Compactions
✅ 09_crashpod 30.5s 5 12 $0.2410 104,921 102,905 2,016 78,555 24,350 — 626 —
✅ 101_loki_historical_logs_pod_deleted 39.8s 6 12 $0.2818 131,040 128,522 2,518 101,257 27,265 — 596 —
✅ 111_pod_names_contain_service 24.5s 4 7 $0.1908 76,774 75,470 1,304 54,471 20,999 — 479 —
✅ 112_find_pvcs_by_uuid 23.9s 5 4 $0.2004 96,546 95,449 1,097 73,666 21,783 — 295 —
✅ 12_job_crashing 30.7s 5 12 $0.3673 105,133 103,235 1,898 56,418 46,817 — 455 —
✅ 176_network_policy_blocking_traffic_no_runbooks 35.7s 6 14 $0.2793 131,637 129,280 2,357 101,715 27,565 — 549 —
✅ 227_count_configmaps_per_namespace[0] 32.2s 7 15 $0.2418 136,031 134,175 1,856 111,748 22,427 — 432 —
✅ 24_misconfigured_pvc 32.2s 6 12 $0.2370 119,234 117,373 1,861 94,246 23,127 — 398 —
✅ 43_current_datetime_from_prompt 4.4s 1 — $0.1079 16,922 16,806 116 0 16,806 — 116 —
✅ 61_exact_match_counting 10.9s 3 2 $0.1338 51,784 51,483 301 33,999 17,484 — 171 —
Total 26.5s avg 4.8 avg 10.0 avg $2.2809 970,022 954,698 15,324 706,075 248,623 — 626 —

Benchmark comparison unavailable: No ci-benchmark experiments found

Benchmark Comparison Details

Baseline: latest ci-benchmark experiment on master

Status: No ci-benchmark experiments found

Comparison indicators:

  • ±0% — diff under 10% (within noise threshold)
  • ↑N%/↓N% — diff 10-25%
  • ↑N%/↓N% — diff over 25% (significant)

✅ Results of HolmesGPT evals

Automatically triggered by commit cc48939 on branch claude/document-http-api-fast-mode-4MkWg

View workflow logs

Results of HolmesGPT evals

  • ask_holmes: 10/10 test cases were successful, 0 regressions
Status Test case Time Turns Tools Cost Total tokens Input Output Cached Non-cached Reasoning Max output Compactions
✅ 09_crashpod 29.6s 5 10 $0.3539 101,613 99,882 1,731 54,360 45,522 — 647 —
✅ 101_loki_historical_logs_pod_deleted 34.4s 6 8 $0.2324 118,289 116,341 1,948 94,461 21,880 — 418 —
✅ 111_pod_names_contain_service 30.5s 5 9 $0.2233 100,072 98,233 1,839 75,886 22,347 — 490 —
✅ 112_find_pvcs_by_uuid 26.4s 6 5 $0.2005 111,809 110,599 1,210 90,598 20,001 — 243 —
✅ 12_job_crashing 31.8s 6 11 $0.2487 127,088 125,348 1,740 100,413 24,935 — 415 —
✅ 176_network_policy_blocking_traffic_no_runbooks 40.4s 7 15 $0.2771 151,774 149,567 2,207 123,881 25,686 — 431 —
✅ 227_count_configmaps_per_namespace[0] 25.7s 6 10 $0.2091 112,309 110,904 1,405 90,221 20,683 — 434 —
✅ 24_misconfigured_pvc 33.6s 6 12 $0.2468 120,985 118,869 2,116 95,263 23,606 — 505 —
✅ 43_current_datetime_from_prompt 4.5s 1 — $0.1079 16,922 16,806 116 0 16,806 — 116 —
✅ 61_exact_match_counting 11.7s 3 2 $0.1343 51,830 51,512 318 34,014 17,498 — 187 —
Total 26.9s avg 5.1 avg 9.1 avg $2.2340 1,012,691 998,061 14,630 759,097 238,964 — 647 —

Benchmark comparison unavailable: No ci-benchmark experiments found

Benchmark Comparison Details

Baseline: latest ci-benchmark experiment on master

Status: No ci-benchmark experiments found

Comparison indicators:

  • ±0% — diff under 10% (within noise threshold)
  • ↑N%/↓N% — diff 10-25%
  • ↑N%/↓N% — diff over 25% (significant)
📖 Legend
Icon Meaning
✅ The test was successful
➖ The test was skipped
⚠️ The test failed but is known to be flaky or known to fail
🚧 The test had a setup failure (not a code regression)
🔧 The test failed due to mock data issues (not a code regression)
🚫 The test was throttled by API rate limits/overload
❌ The test failed and should be fixed before merging the PR
🔄 Re-run evals manually

⚠️ Warning: /eval comments always run using the workflow from master, not from this PR branch. If you modified the GitHub Action (e.g., added secrets or env vars), those changes won't take effect.

To test workflow changes, use the GitHub CLI or Actions UI instead:

gh workflow run eval-regression.yaml --repo HolmesGPT/holmesgpt --ref claude/document-http-api-fast-mode-4MkWg -f markers=regression -f filter=

Option 1: Comment on this PR with /eval:

/eval
tags: regression

Or with more options (one per line):

/eval
model: gpt-4o
tags: regression
filter: 09_crashpod
iterations: 5

Run evals on a different branch (e.g., master) for comparison:

/eval
branch: master
tags: regression
Option Description
model Model(s) to test (default: same as automatic runs)
tags Pytest tags / markers (no default - runs all tests!)
filter Pytest -k filter (use /list to see valid eval names)
iterations Number of runs, max 10
branch Run evals on a different branch (for cross-branch comparison)

Quick re-run: Use /rerun to re-run the most recent /eval on this PR with the same parameters.

Option 2: Trigger via GitHub Actions UI → "Run workflow"

Option 3: Add PR labels to include extra evals in automatic regression runs:

Label Effect
evals-tag-<name> Run tests with tag <name> alongside regression
evals-id-<name> Run a specific eval by test ID

Examples: evals-tag-easy, evals-id-09_crashpod

🏷️ Valid tags

benchmark, chain-of-causation, compaction, confluence, context_window, coralogix, counting, database, datadog, datetime, db-connectors, easy, elasticsearch, embeds, fast, frontend, grafana-dashboard, hard, integration, kafka, kubernetes, leaked-information, logs, loki, medium, metrics, network, newrelic, no-cicd, numerical, one-test, port-forward, prometheus, question-answer, regression, runbooks, slackbot, storage, toolset-limitation, traces, transparency


Commands: /eval · /rerun · /list

CLI: gh workflow run eval-regression.yaml --repo HolmesGPT/holmesgpt --ref claude/document-http-api-fast-mode-4MkWg -f markers=regression -f filter=

@github-actions

github-actions Bot commented Mar 12, 2026 •

Copy link
Copy Markdown
Contributor

✅ Docker images ready for 99f7309a (built in 6m 8s)

⚠️ Warning: does not support ARM (ARM images are built on release only - not on every PR)

Use these tags to pull the images for testing.

📋 Copy commands

⚠️ Temporary images are deleted after 30 days. Copy to a permanent registry before using them:

gcloud auth configure-docker us-central1-docker.pkg.dev
docker pull us-central1-docker.pkg.dev/robusta-development/temporary-builds/holmes:99f7309a
docker tag us-central1-docker.pkg.dev/robusta-development/temporary-builds/holmes:99f7309a me-west1-docker.pkg.dev/robusta-development/development/holmes-dev:99f7309a
docker push me-west1-docker.pkg.dev/robusta-development/development/holmes-dev:99f7309a
docker pull us-central1-docker.pkg.dev/robusta-development/temporary-builds/holmes-operator:99f7309a
docker tag us-central1-docker.pkg.dev/robusta-development/temporary-builds/holmes-operator:99f7309a me-west1-docker.pkg.dev/robusta-development/development/holmes-operator-dev:99f7309a
docker push me-west1-docker.pkg.dev/robusta-development/development/holmes-operator-dev:99f7309a

Patch Helm values in one line (choose the chart you use):

HolmesGPT chart:

helm upgrade --install holmesgpt ./helm/holmes \
  --set registry=me-west1-docker.pkg.dev/robusta-development/development \
  --set image=holmes-dev:99f7309a \
  --set operator.registry=me-west1-docker.pkg.dev/robusta-development/development \
  --set operator.image=holmes-operator-dev:99f7309a

Robusta wrapper chart:

helm upgrade --install robusta robusta/robusta \
  --reuse-values \
  --set holmes.registry=me-west1-docker.pkg.dev/robusta-development/development \
  --set holmes.image=holmes-dev:99f7309a \
  --set holmes.operator.registry=me-west1-docker.pkg.dev/robusta-development/development \
  --set holmes.operator.image=holmes-operator-dev:99f7309a

@github-actions

github-actions Bot commented Mar 12, 2026 •

Copy link
Copy Markdown
Contributor

🔬 CLI Performance Benchmark

🟡 Startup Time (no LLM)

Measures holmes version execution time (imports + initialization)

Metric PR Master Change
Cold Start 11.54s 11.27s +2.4%
Warm Mean 5.20s 5.06s +2.7%
Warm Min 5.10s 5.04s
Warm Max 5.32s 5.10s

🟡 Full CLI with LLM

Measures holmes ask execution time (OpenRouter + Haiku 4.5)

Metric PR Master Change
Cold Start 28.50s 24.84s +14.8%
Warm Mean 8.38s 7.78s +7.7%
Warm Min 8.14s 7.68s
Warm Max 8.98s 7.82s

PR: 99f7309a | Master: 6edab8e5 | Iterations: 5

@aantn
aantn enabled auto-merge (squash) March 12, 2026 07:34
@aantn
aantn merged commit cc83782 into master Mar 12, 2026
21 of 22 checks passed
@aantn
aantn deleted the claude/document-http-api-fast-mode-4MkWg branch March 12, 2026 08:05
@coderabbitai coderabbitai Bot mentioned this pull request Apr 14, 2026
1 of 2 tasks
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.

3 participants