test(cli): add tests reproducing #8391 external-directory allow override#8979
Open
kilo-code-bot[bot] wants to merge 2 commits intomainfrom
Open
test(cli): add tests reproducing #8391 external-directory allow override#8979kilo-code-bot[bot] wants to merge 2 commits intomainfrom
kilo-code-bot[bot] wants to merge 2 commits intomainfrom
Conversation
… override Add 21 tests verifying that permission.external_directory and permission.read set to allow correctly prevent repeated approval prompts for external-directory reads. Tests cover: - Permission.evaluate returns allow when user config overrides defaults - Permission.ask resolves immediately with allow ruleset - Read tool does not block for external files when both permissions allow - Multiple external directories handled without prompting - KILO_CONFIG_CONTENT override as a bug reproduction path - Truncate.GLOB post-processing does not interfere - ConfigProtection bypasses file-tool external_directory requests - always approval remains directory-scoped (negative test) Closes #8391
| const merged = Permission.merge(defaults(), user) | ||
| const ext = Permission.evaluate("external_directory", "/tmp/outside/*", merged) | ||
| // BUG PATH: user set "allow" but gets "deny" due to KILO_CONFIG_CONTENT override | ||
| expect(ext.action).toBe("deny") |
Contributor
Author
There was a problem hiding this comment.
WARNING: This assertion locks in the current override bug
This suite is meant to protect the user-visible fix for #8391, but expect(ext.action).toBe("deny") makes the current KILO_CONFIG_CONTENT precedence bug the expected outcome. If config precedence is corrected so the project-level external_directory: "allow" wins, this test will start failing and block the fix.
Contributor
Author
Code Review SummaryStatus: 1 Issue Found | Recommendation: Address before merge Overview
Fix these issues in Kilo Cloud Issue Details (click to expand)WARNING
Other Observations (not in diff)Issues found in unchanged code that cannot receive inline comments: None. Files Reviewed (2 files)
Reviewed by gpt-5.4-20260305 · 506,884 tokens |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
packages/opencode/test/kilocode/permission/external-directory-allow.test.tsthat reproduce and verify the expected behavior for issue Repeated external-directory read approval prompts even when external_directory and read are both set to allow #8391Permission.evaluateunit tests,Permission.askintegration, Read tool execution, and config loading — all verifying thatexternal_directory: "allow"+read: "allow"should prevent repeated promptsKILO_CONFIG_CONTENT(used by the VS Code extension and cloud agents) can silently override user-configured permissions, which is one manifestation of the bugCloses #8391