Skip to content

RSPEED-3313: inline single-use helpers and drop redundant None assignments in rlsapi_v1#1996

Open
major wants to merge 1 commit into
lightspeed-core:mainfrom
major:ponytail/rlsapi-cleanup
Open

RSPEED-3313: inline single-use helpers and drop redundant None assignments in rlsapi_v1#1996
major wants to merge 1 commit into
lightspeed-core:mainfrom
major:ponytail/rlsapi-cleanup

Conversation

@major

@major major commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Pure refactor of src/app/endpoints/rlsapi_v1.py to reduce indirection and redundant code.

  • Inline _get_cla_version, _get_configured_default_model_name, _is_verbose_enabled, and _get_prompt_template at their sole call sites
  • Reduce _compile_prompt_template lru_cache maxsize from 8 to 1 (only one system prompt exists at a time)

No behavior change. All 63 existing unit tests pass without modification.

- Inline _get_cla_version, _get_configured_default_model_name,
  _is_verbose_enabled, and _get_prompt_template at their sole call sites
- Reduce _compile_prompt_template lru_cache maxsize from 8 to 1 since
  only one system prompt exists at a time

Signed-off-by: Major Hayden <major@redhat.com>
@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The /infer endpoint now resolves the system prompt directly, derives Splunk telemetry fields inline, and computes verbose mode inline from request and configuration.

Changes

RLSAPI v1 infer path cleanup

Layer / File(s) Summary
System prompt compilation
src/app/endpoints/rlsapi_v1.py
_build_instructions selects the prompt source inline and renders it through _compile_prompt_template.
Telemetry and verbose flag
src/app/endpoints/rlsapi_v1.py
_queue_splunk_event derives the model name and cla_version inline, and infer_endpoint computes verbose_enabled inline from request metadata and configuration.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

ok-to-test

Suggested reviewers

  • tisnik
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main refactor: inlining single-use helpers and removing redundant None assignments in rlsapi_v1.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
✨ Simplify code
  • Create PR with simplified code

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.

@major major force-pushed the ponytail/rlsapi-cleanup branch from 2c6c4ac to 7508746 Compare June 25, 2026 12:48
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