feat(source): add timeout to add-research imports#262
feat(source): add timeout to add-research imports#262voidborne-d wants to merge 3 commits intoteng-lin:mainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdded a Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/cli-reference.md`:
- Line 114: The table row for the add-research CLI entry breaks parsing and the
example omits --import-all; fix by escaping the pipe in the flags cell (change
`--mode [fast|deep]` to `--mode [fast\|deep]` or otherwise escape the `|` inside
the code span), ensure the `--timeout FLOAT` cell remains code-formatted, and
update the example to show the timeout together with import-all (e.g. `source
add-research "AI" --mode deep --timeout 600 --import-all`) so semantics are
correct; apply these changes to the add-research table row (symbols:
add-research, --mode [fast|deep], --timeout FLOAT, --import-all).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: d463b3fd-ce17-4f00-b68a-135c38753557
📒 Files selected for processing (3)
docs/cli-reference.mdsrc/notebooklm/cli/source.pytests/unit/cli/test_source.py
There was a problem hiding this comment.
Code Review
This pull request introduces a --timeout option to the source add-research CLI command, allowing users to specify a retry budget for importing sources. The documentation and tests have been updated to reflect this change. Feedback suggests removing the FLOAT type hint from the cli-reference.md for consistency and changing the --timeout option's type to int in source.py, also for consistency, and clarifying its scope to cover both research and import phases.
docs/cli-reference.md
Outdated
| | `add <content>` | URL/file/text | - | `source add "https://..."` | | ||
| | `add-drive <id> <title>` | Drive file ID | - | `source add-drive abc123 "Doc"` | | ||
| | `add-research <query>` | Search query | `--mode [fast|deep]`, `--from [web|drive]`, `--import-all`, `--no-wait` | `source add-research "AI" --mode deep --no-wait` | | ||
| | `add-research <query>` | Search query | `--mode [fast|deep]`, `--from [web|drive]`, `--import-all`, `--timeout FLOAT`, `--no-wait` | `source add-research "AI" --mode deep --timeout 600` | |
There was a problem hiding this comment.
Remove the FLOAT type hint from the options list to maintain consistency with other entries in the table, which do not specify types for options.
| | `add-research <query>` | Search query | `--mode [fast|deep]`, `--from [web|drive]`, `--import-all`, `--timeout FLOAT`, `--no-wait` | `source add-research "AI" --mode deep --timeout 600` | | |
| | `add-research <query>` | Search query | `--mode [fast|deep]`, `--from [web|drive]`, `--import-all`, `--timeout`, `--no-wait` | `source add-research "AI" --mode deep --timeout 600` | |
| "--timeout", | ||
| type=float, | ||
| default=1800.0, | ||
| show_default=True, | ||
| help="Retry budget in seconds when --import-all is used", | ||
| ) |
There was a problem hiding this comment.
For consistency with other commands in the source group (such as source wait), consider using type=int for the --timeout option. Additionally, since the command performs both research polling and source importing, the timeout should ideally apply to the entire operation rather than just the import phase.
| "--timeout", | |
| type=float, | |
| default=1800.0, | |
| show_default=True, | |
| help="Retry budget in seconds when --import-all is used", | |
| ) | |
| "--timeout", | |
| type=int, | |
| default=1800, | |
| show_default=True, | |
| help="Maximum seconds to wait for research and import", |
Summary
--timeoutoption tosource add-researchso--import-allcan use an explicit retry budgetTesting
Closes #194
Summary by CodeRabbit
New Features
Documentation
Tests