test(dcode): cover secret rejection exit code - #8148
Conversation
📝 WalkthroughWalkthroughThe PR adds a regression test for raw Changesdcode secret validation
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
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 `@test/dcode-wrapper-identity.test.ts`:
- Line 198: Update the redaction assertion in the runBashWrapper refusal-path
test to verify that the secret does not appear in either captured output stream,
checking both run.stdout and run.stderr while preserving the existing
public-boundary behavior.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 08e7fc8b-b2a0-4c67-bed8-61a94fc5738a
📒 Files selected for processing (1)
test/dcode-wrapper-identity.test.ts
|
Closing this test-only PR. The current source and v0.0.81 tag already return exit code 2 for this guard, so #8137 needs artifact-level reproduction before a production fix can be proposed. |
PR Review Advisor — No blocking findings reportedAdvisor assessment: No blocking advisor findings reported Model lanes
2 additional E2E selections from the second opinionAdvisory only. The primary lane did not select these E2E jobs or targets.
Second-opinion terminology and E2E selections are advisory. They do not change the primary assessment or E2E / PR Gate. 1 semantic terminology decisionTerminology decisions are advisory. They affect the assessment only when a separate finding identifies concrete semantic impact.
E2E guidanceAdvisory only. E2E / PR Gate selects and runs jobs independently. Recommended E2E: None 2 optional E2E recommendations
This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge. |
Summary
Add a Linux regression test for dcode secret rejection. The test covers a raw
OPENAI_API_KEYin the managed.envfile and verifies exit code2, no launch, and no secret leakage. The current wrapper already implements this behavior; the test protects the contract reported by #8137.Related Issue
Fixes #8137
Changes
OPENAI_API_KEY=sk-live-....envcase to the dcode wrapper security-boundary test.2, no dcode launch, the variable name in the refusal, and absence of the raw value.Type of Change
Quality Gates
Documentation Writer Review
no-docs-neededDGX Station Hardware Evidence
Verification
Signed-off-by:line and every commit appears asVerifiedin GitHubpre-commit,commit-msg, andpre-pushhooks passed, ornpm run check:diffpassed when hooks were skipped or unavailable —npm run check:diffreached the repository checks; all applicable file checks and the secret scan passed, but the existing source-architecture budget failed becausesrc/lib/core/shell-quote.tsfan-in is 26 against a 27 limit.npx vitest run --project integration test/dcode-wrapper-identity.test.tscollected 26 Linux-only tests and skipped them on macOS. The related supervisor and empty-prompt tests passed 2 tests, with 18 Linux-only tests skipped.npm testfor broad runtime/test-harness changes;npm run checkfor repo-wide validation/coverage changes — command/result:npm run docsbuilds without warnings (doc changes only)Signed-off-by: Vinay Bhagavath bhagavathvinay@gmail.com
Summary by CodeRabbit