Skip to content

LCORE-4718: Agent Construction from Responses Request - #3349

Draft
jrobertboos wants to merge 8 commits into
lightspeed-core:mainfrom
jrobertboos:lcore-4718
Draft

jrobertboos wants to merge 8 commits into
lightspeed-core:mainfrom
jrobertboos:lcore-4718

Conversation

@jrobertboos

@jrobertboos jrobertboos commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Description

Draft Status

  • Compaction
  • Knowledge
  • MCP
  • Shield
  • Skill
  • Step Persistence

Type of change

  • Refactor
  • New feature
  • Bug fix
  • CVE fix
  • Optimization
  • Documentation Update
  • Configuration Update
  • Bump-up service version
  • Bump-up dependent library [pyproject.toml + uv.lock]
  • Bump-up dependent library [requirements.*.txt for Konflux]
  • Bump-up library or tool used for development (does not change the final image)
  • CI configuration change
  • Konflux configuration change
  • Unit tests improvement
  • Integration tests improvement
  • End to end tests improvement
  • Benchmarks improvement

Tools used to create PR

Identify any AI code assistants used in this PR (for transparency and review context)

  • Assisted-by: (e.g., Claude, CodeRabbit, Ollama, etc., N/A if not used)
  • Generated by: (e.g., tool name and version; N/A if not used)

Related Tickets & Documents

  • Related Issue #
  • Closes #

Checklist before requesting a review

  • I have performed a self-review of my code.
  • PR has passed all pre-merge test jobs.
  • If it is a core feature, I have added thorough tests.

Testing

  • Please provide detailed steps to perform tests related to this code change.
  • How were the fix/results from this change verified? Please provide relevant screenshots or results.

@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
Pre-merge checks: Passed 2

Check name Status Explanation
Performance And Algorithmic Complexity Passed Summary: No meaningful performance regression found in the PR's source changes. The check passes. Scope and evidence - The PR branch lcore-4718 is not present in the sandbox. The local HEAD …
Security And Secret Handling Passed Result: PASSED. No violation of the five security criteria found in the PR's changes. Scope reviewed - PR #3349 (lightspeed-core/lightspeed-stack), author jrobertboos, head lcore-4718 → ba…
Full details: Performance And Algorithmic Complexity

Explanation

Summary: No meaningful performance regression found in the PR's source changes. The check passes. Scope and evidence - The PR branch lcore-4718 is not present in the sandbox. The local HEAD commit 7369e47e ("tmp", author JR Boos, the PR author) changes src/agent/types/settings/*. This matches the PR title, so I reviewed git diff HEAD~1 HEAD -- src/. - The new code is from_responses_request in agent.py, compaction.py, knowledge.py, mcp.py, shield.py, and skill.py. Issues checked against the criteria 1. O(n²) on non-trivial inputs: None. The nested work is bounded by small inputs. - knowledge.py: for each configured source, item_id in requested (O(S×R)). S is the configured source count. R is the file-search store ids in one request. - mcp.py: for each request tool, tool_name not in merged on a list (O(T×K)). T and K are the tools and allowed names in one request. This is not a K8s list or a large dataset. 2. N+1: None. There are no per-item API or DB calls. 3. Expensive work inside loops: One pattern, mcp.py from_responses_request. For each configured MCP server, it reads secret files (Path(...).read_text()). This is per request and per server. The existing from_query_request has the same code, so this PR duplicates the behavior rather than adding a new cost. The loop count is the configured server count, which is small. I treat this as a low-risk observation, not a regression. The JSON parse in _get_mcp_headers_from_request runs once per call. 4. Unbounded growth: None. The new code creates per-request lists and dataclasses. It does not add caches, watchers, or buffers. 5. Missing pagination or limits: Not applicable. The change adds no List operation or endpoint. The new code reads only the configured shields, sources, skills, and MCP servers. Residual note: Request list sizes (tools, allowed_tools, vector_store_ids) come from the client. The code has no explicit cap, but the quadratic cost applies only to these small lists. This does not meet the criterion's threshold.

Full details: Security And Secret Handling

Explanation

Result: PASSED. No violation of the five security criteria found in the PR's changes. Scope reviewed - PR #3349 (lightspeed-core/lightspeed-stack), author jrobertboos, head lcore-4718 → base main. - The checked-out HEAD commit 7369e47e adds from_responses_request builders under src/agent/types/settings/ (agent.py, mcp.py, compaction.py, knowledge.py, shield.py, skill.py) and matching unit tests. - The branch also differs from origin/main in about 75 src/ files. I scanned those diffs with targeted searches, not a full line-by-line review. Criteria 1. Secrets in logs or source: No hardcoded secret literals were added. The new code sends MCP header values only into settings objects. The only log lines touching headers are the pre-existing MCP headers decode error: %s (logs the JSON error, not the payload) and the secret-file warning, which logs the file path and OS error, not the secret contents. 2. Missing auth on endpoints: The src/ diff adds no route decorators. The new builders are not yet wired to any endpoint in this commit. 3. Injection: No subprocess, os.system, shell=True, or string-built SQL was added. Path(value) reads from configuration, not from request input. tool.server_label is matched against configured server names only. 4. Sensitive data in responses, WebSocket messages, or logs: The Bearer {token} value and client MCP headers are stored in MCPSettings.headers. No new response model, WebSocket message, or log line emits them. 5. K8s or RH Secrets without OwnerReferences: No Secret creation and no ownerReferences changes appear in the diff. Limitation The full branch diff against main (about 288 files) was not reviewed line by line. The verdict covers the visible change set and the targeted scans above.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

This branch has not been deployed

No deployments
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