Skip to content

Address code review feedback for RAG agent implementation#95

Closed
Copilot wants to merge 2 commits intofeature/python/rag-agentfrom
copilot/sub-pr-94
Closed

Address code review feedback for RAG agent implementation#95
Copilot wants to merge 2 commits intofeature/python/rag-agentfrom
copilot/sub-pr-94

Conversation

Copy link
Copy Markdown

Copilot AI commented Nov 28, 2025

Addresses all feedback from automated code review on the RAG agent implementation.

app.py

  • Remove unused asyncio import and metadata variable
  • Add proper Content-Type validation via request.is_json
  • Add subprocess error checking for crawler/vectorize scripts
  • Add input validation: MAX_MESSAGES=50, MAX_CONTENT_LENGTH=100KB
  • Replace word-based token estimation with tiktoken

rag_agent.py

  • Fix ChromaDB score threshold logic (>=<= since lower distance = better match)
  • Extract duplicate fallback retrieval into _fallback_retrieval() helper
  • Add _create_llm_with_temperature() for thread-safe temperature override
# Before: mutating shared LLM state (thread-unsafe)
self.llm.temperature = temperature

# After: create isolated instance
llm_to_use = self._create_llm_with_temperature(temperature)

crawler.py

  • Fix page type detection: "latest-news" in page"latest-news" in self.page.url

vectorize_documents.py

  • Use function parameters for chunk_size/chunk_overlap instead of hardcoded values

README.md

  • Fix typo "requiments" → "requirements"
  • Fix command web.pyapp.py
  • Fix port references 8000 → 8080

requirements.txt

  • Add explicit tiktoken dependency

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI self-assigned this Nov 28, 2025
Co-authored-by: xujiongze <31494901+xujiongze@users.noreply.github.com>
Copy link
Copy Markdown
Author

Copilot AI commented Nov 28, 2025

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com//advisories
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Add RAG agent implementation for IOC.EAssistant Address code review feedback for RAG agent implementation Nov 28, 2025
Copilot AI requested a review from xujiongze November 28, 2025 21:59
@xujiongze xujiongze closed this Nov 28, 2025
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.

2 participants