Skip to content

Feat/chat w specified files#306

Draft
Ahmath-Gadji wants to merge 6 commits intodevfrom
feat/chat_w_specified_files
Draft

Feat/chat w specified files#306
Ahmath-Gadji wants to merge 6 commits intodevfrom
feat/chat_w_specified_files

Conversation

@Ahmath-Gadji
Copy link
Copy Markdown
Collaborator

No description provided.

- Add Attachment Pydantic model for file validation
- Add MetadataDict TypedDict for type-safe metadata hints
- File-based retrieval bypasses semantic search when attachments provided
- Parallel chunk retrieval using asyncio.gather in vectordb
- File existence check before querying (prevents empty queries)
- Filter expression pattern like async_search (handles ['all'] and partition lists)
- Timeout handling with graceful degradation
- Add design spec to docs/superpowers/specs/
- Add AGENTS.md with build/lint/test commands and code style guidelines
- Add Attachment model validation tests (11 tests)
- Add filter expression building tests (3 tests)
- Add attachment filtering tests (3 tests)
- Add API integration tests for attachments (8 tests)
- Fix MetadataDict TypedDict in openai.py
Test coverage:
- Attachment model: required id, all fields, validation errors
- MetadataDict: empty, with attachments, with all fields, unknown fields
- Filter expressions: specific partitions, all partitions
- API endpoint: empty attachments, valid format, missing id, empty id, extra fields, null, single attachment
- Two strategies: Refine (iterative) and Map-Reduce (parallel)
- FileReducer class in components/file_reducer.py
- Integration with RagPipeline for on-demand reduction
- Remove MetadataDict TypedDict, use dict[str, Any] for metadata
- Strategy field added to Attachment model (default: 'refine')
- Configuration in .hydra_config/config.yaml
- Auto-switch from refine to map_reduce for large chunk counts
- Proper metadata preservation (file_id, partition)
- Refine strategy with custom system prompt
- Map-Reduce reuses existing system_prompt_map from map_reduce.py
- Comprehensive test coverage including edge cases

Spec review: All issues addressed and approved
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 15, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 91d1dcab-9970-49fd-a064-701dd6d36ac6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/chat_w_specified_files

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.

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