Conversation
Greptile OverviewGreptile SummaryImplements a local file/folder connector that allows Craft users to upload raw binary files (Excel, PowerPoint, Word, CSV, etc.) to their sandbox environment for agent access, with per-file sync control and quota management. Key changes:
Architecture decisions:
Known limitations documented in code:
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Frontend as UserLibraryModal
participant API as user_library.py
participant DB as user_library DB
participant Storage as S3/LocalStorage
participant Sandbox as SandboxManager
User->>Frontend: Upload files
Frontend->>API: POST /upload (files, path)
API->>DB: Check storage quota
API->>DB: Get/create CRAFT_FILE connector
loop For each file
API->>Storage: Write raw binary file
API->>DB: Upsert document metadata
end
API->>DB: Update connector status
API->>Sandbox: Trigger file sync (Celery task)
API-->>Frontend: Upload response
User->>Frontend: Toggle file sync
Frontend->>API: PATCH /files/{id}/toggle
API->>DB: Update doc_metadata (sync_disabled)
API-->>Frontend: Success
User->>Frontend: Delete file
Frontend->>API: DELETE /files/{id}
API->>Storage: Delete raw file
API->>DB: Delete document record
API->>Sandbox: Trigger file sync
API-->>Frontend: Success
Note over Sandbox: Sync task filters disabled files<br/>and creates symlinks in workspace
|
51856e5 to
0fe294a
Compare
0fe294a to
bd7da75
Compare
|
@greptile |
|
@rohoswagger I have started the AI code review. It will take a few minutes to complete. |
|
Preview Deployment
|
There was a problem hiding this comment.
1 issue found across 5 files (changes from recent commits).
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="backend/onyx/background/indexing/run_docfetching.py">
<violation number="1" location="backend/onyx/background/indexing/run_docfetching.py:684">
P2: RAW_BINARY batches now fall into the regular docprocessing path because the explicit guard was removed. If a RAW_BINARY connector yields a batch, it will be processed and queued despite being documented as bypassing the connector indexing flow. Add an explicit RAW_BINARY guard (as before) to skip those batches.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| file_name = file_path.split("/")[-1] | ||
|
|
||
| # Guess content type | ||
| content_type, _ = mimetypes.guess_type(file_name) |
There was a problem hiding this comment.
we have a util for this im p sure
There was a problem hiding this comment.
didnt find one, we just use mimetypes.guess_type()
| enabled: bool = Query(...), | ||
| user: User = Depends(current_user), | ||
| db_session: Session = Depends(get_session), | ||
| ) -> dict[str, Any]: |
| ) | ||
| heredoc_delim = f"_EXCL_{uuid4().hex[:12]}_" | ||
| files_symlink_setup = f""" | ||
| # Create filtered files directory with exclusions |
There was a problem hiding this comment.
ideally this should be a separate python (or really any high level language) script that lives in our repo which gets copied onto the pod and invoked with the right arguments
backend/onyx/server/features/build/sandbox/kubernetes/kubernetes_sandbox_manager.py
Outdated
Show resolved
Hide resolved
|
@greptile |
|
@rohoswagger I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
1 issue found across 32 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="web/src/app/craft/v1/configure/components/ConfigureOverlays.tsx">
<violation number="1" location="web/src/app/craft/v1/configure/components/ConfigureOverlays.tsx:55">
P2: When isUpdating is true, this still renders a clickable action button with no handler, so users can focus/click a non-functional control. Consider hiding or disabling the action while updating instead of leaving an enabled button with no onAction.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
feat: local file/folder connector :big_grin:
Description
a big one
How Has This Been Tested?
locally, craft-dev
Additional Options