test(sdk): add slash install smoke matrix#229
Conversation
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
📝 Walkthrough
WalkthroughThis PR introduces IDE/agent selection to the Gradata hooks installer CLI. The ChangesIDE-aware hooks installer
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Suggested labels
🚥 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 docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 OpenGrep (1.22.0)OpenGrep fatal error (exit code 2): �[32m✔�[39m �[1mOpengrep OSS�[0m �[1m Loading rules from local config...�[0m Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@Gradata/src/gradata/cli.py`:
- Around line 1846-1855: The CLI currently accepts --ide for all hooks actions
but only applies it for install; update the hooks command handling so that
args.ide is either respected or rejected consistently: inside the hooks command
dispatcher (where args.ide is read and where _cmd_install_agent(...) is called),
detect non-install actions (e.g., uninstall, status) and either map args.ide to
args.agent for those actions or raise/print an error informing the user that
--ide is only valid with the install subcommand; specifically modify the block
using getattr(args, "ide", "claude-code") and the dispatcher that handles hooks
to refuse or handle --ide for non-install commands instead of silently ignoring
it, ensuring tests and help messages reflect the rule.
🪄 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: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 1f5dce8c-4261-4650-a29a-c87cfe543385
📒 Files selected for processing (2)
Gradata/src/gradata/cli.pyGradata/tests/test_install_smoke_matrix.py
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
- GitHub Check: pytest ubuntu-latest / py3.11
- GitHub Check: pytest windows-latest / py3.11
- GitHub Check: pytest windows-latest / py3.12
- GitHub Check: pytest ubuntu-latest / py3.12
- GitHub Check: pytest macos-latest / py3.12
- GitHub Check: pytest macos-latest / py3.11
- GitHub Check: pytest (py3.12)
- GitHub Check: pytest (py3.11)
🧰 Additional context used
📓 Path-based instructions (2)
Gradata/src/**/*.py
📄 CodeRabbit inference engine (Gradata/AGENTS.md)
Gradata/src/**/*.py: Prefersentence-transformersfor local embeddings,google-genaifor Gemini embeddings,cryptographyfor AES-GCM encrypted system.db,bm25sfor BM25 rule ranking, andmem0aifor external memory adapters — guard all optional dependency imports withtry / except ImportErrorat the call site, never at module level
Maintain strict layering: Layer 0 (Primitives: _types.py, _db.py, _events.py, _paths.py, _file_lock.py; Patterns: contrib/patterns/) must never import from Layer 1 (Enhancements: enhancements/, rules/) or Layer 2 (Public API: brain.py, cli.py, daemon.py, mcp_server.py)
Never use bareexcept: pass— use typed exceptions or at minimumlogger.warning(...)withexc_info=Trueto avoid silent failure in a memory product
Never import from out-of-scope sibling directories../Sprites/or../Hausgem/withingradata/*code — that is a layering bug
Never leak private-sibling paths into public docs/code — no references to../Sprites/,../Hausgem/, email addresses, OneDrive paths, or Sprites-specific examples from insidegradata/*
Use atomic-write helper when writing JSON files to prevent corruption from mid-write crashes
Files:
Gradata/src/gradata/cli.py
Gradata/tests/**/*.py
📄 CodeRabbit inference engine (Gradata/AGENTS.md)
Gradata/tests/**/*.py: SetBRAIN_DIRenvironment variable viatmp_pathin conftest.py for test isolation — ensure_paths.pymodule cache refreshes when callingBrain.init()directly inside tests
Add unit tests intests/test_*.pyfor every CI push without LLM calls (deterministic); mark integration tests with@pytest.mark.integrationand skip them by default (they hit real LLM APIs)
Files:
Gradata/tests/test_install_smoke_matrix.py
🔇 Additional comments (1)
Gradata/tests/test_install_smoke_matrix.py (1)
17-31: LGTM!Also applies to: 41-107, 109-180, 182-184
| ide = getattr(args, "ide", "claude-code") | ||
| if ide != "claude-code": | ||
| # The legacy one-command installer calls `gradata hooks install | ||
| # --ide <host>`. Claude Code keeps using the richer hook installer | ||
| # below; other hosts are wired through the adapter-based install | ||
| # path used by `gradata install --agent <host>`. | ||
| args.agent = ide | ||
| _cmd_install_agent(args) | ||
| return | ||
|
|
There was a problem hiding this comment.
--ide is globally accepted but ignored for non-install actions
Line 2170 adds --ide for all hooks actions, but Line 1846-1855 only applies it in install. hooks uninstall --ide codex is currently accepted and silently ignored, which is misleading and can cause users to think Codex uninstall/status was handled.
Proposed fix
def cmd_hooks(args):
"""Manage Claude Code hook integration."""
action = args.action
+ ide = getattr(args, "ide", "claude-code")
+ if action in ("uninstall", "status") and ide != "claude-code":
+ print(
+ "error: --ide is only supported for `hooks install`; "
+ "use `gradata uninstall --agent <host>` for non-claude hosts",
+ file=sys.stderr,
+ )
+ sys.exit(2)
+
if action == "install":
- ide = getattr(args, "ide", "claude-code")
if ide != "claude-code":
# The legacy one-command installer calls `gradata hooks install
# --ide <host>`. Claude Code keeps using the richer hook installer
# below; other hosts are wired through the adapter-based install
# path used by `gradata install --agent <host>`.
args.agent = ide
_cmd_install_agent(args)
returnAlso applies to: 2170-2175
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@Gradata/src/gradata/cli.py` around lines 1846 - 1855, The CLI currently
accepts --ide for all hooks actions but only applies it for install; update the
hooks command handling so that args.ide is either respected or rejected
consistently: inside the hooks command dispatcher (where args.ide is read and
where _cmd_install_agent(...) is called), detect non-install actions (e.g.,
uninstall, status) and either map args.ide to args.agent for those actions or
raise/print an error informing the user that --ide is only valid with the
install subcommand; specifically modify the block using getattr(args, "ide",
"claude-code") and the dispatcher that handles hooks to refuse or handle --ide
for non-install commands instead of silently ignoring it, ensuring tests and
help messages reflect the rule.
Summary
gradata hooks install --idecovering Claude Code and Codexgradata-installwrapper routing for Claude Code and CodexTest