Repository navigation
feat(kap-server): add allow_ignored_globs to fs:list for un-ignoring named paths - #4058
Conversation
…named paths The list filter keeps gitignored entries hidden unless they match the new allow_ignored_globs request field, letting callers surface specific ignored paths (e.g. .tmp) while the rest of gitignore still applies.
🦋 Changeset detectedLatest commit: c97fd65 The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a3318e4f23
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…ches A nested allow glob such as ignored-dir/keep.txt or ignored-dir/** used to be unreachable in recursive listings because the ignored parent was skipped before any child could match. Keep an ignored entry when it is a literal-prefix ancestor of an allowed glob (directories only), and document that dot-path allowances additionally require show_hidden.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f3a7736c7a
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
The literal-prefix check still dropped ancestors when a directory segment of an allow glob contained a wildcard, e.g. ignored-*/keep.txt or ignored-dir/**/keep.txt. Decide reachability by consuming the candidate path segment-wise against a prefix of the glob instead.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7b44ce4004
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Compile **/ to (?:[^/]+/)* so recursive wildcards preserve path segment boundaries; a/**/b no longer matches a/xxb. This affects include_globs, exclude_globs, and allow_ignored_globs across fs:list / fs:search / fs:suggest / fs:grep. Match glob prefixes iteratively in globCanMatchBelow so deeply segmented globs cannot exhaust the call stack.
…hotAI/kimi-code into feat/fs-list-include-globs
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4e5d155ffb
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
foo**/keep.txt regressed when **/ gained segment-boundary semantics: the stars sat mid-segment but were expanded as a whole-segment globstar. Only expand **/ when the stars open a path segment, treat mid-segment stars as an ordinary within-segment wildcard, and keep a trailing ** matching across segments as before.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 211b2933d6
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…cestors Replace the hand-rolled glob compiler with picomatch, the standard engine already used elsewhere in the package, which settles segment boundary, mid-segment globstar, and deep-pattern complexity edge cases for good. An ignored directory kept only as a possible ancestor of an allow glob is now probed (depth and entry capped, fail-open) and withheld when no descendant actually matches.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: da7280837d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Splitting allow globs on '/' corrupts brace and extglob constructs that contain slashes; take path segments from picomatch.scan instead and fall back to a conservative answer for opaque single-token globs, letting the descendant probe decide visibility with whole-pattern matching. Probe budgets are now shared across one fs:list request instead of resetting per candidate directory, so a tree full of speculative ancestors cannot multiply filesystem operations.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6f93b02315
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
picomatch throws on empty patterns where the old compiler simply never matched, turning previously valid requests into server errors; filter them out up front. Brace and extglob alternatives that embed a slash inside one scanned part now fall back to the conservative ancestor answer as well, leaving visibility to the whole-pattern descendant probe.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0f2b2b8fd3
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
A leading exclamation mark was a literal character in the old matcher, so exclude_globs like !foo only matched a path literally named !foo; as a picomatch negation the same request would exclude everything except foo. Pin the prior semantics with nonegate.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c49ff4645b
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
The scan call still used default negation, stripping a literal leading bang from allowance prefixes like !foo/keep.txt. Consecutive separators produced empty scanned segments that made picomatch throw during prefix compilation; empty segments now simply match nothing.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c97fd65f27
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Requirement or Bug
让
fs:list的调用方能点名放行个别被 gitignore 的路径(例如.tmp),同时保持其余 gitignore 过滤不变。Bug Reproduction Steps
N/A
Root Cause
N/A
Code Changes
fs:list新增可选请求字段allow_ignored_globs: string[]:被 gitignore 命中的条目,在命中该字段(或其某个被忽略祖先目录命中有匹配后代)时保留。packages/agent-core-v2/src/workspace/workspaceFs/fs.ts的fsListRequestSchema加allow_ignored_globs。fsService.list的子项过滤循环按上述逻辑放行;只作为「可能祖先」保留的目录会先做一次有界探测(深度 ≤ 6、条目 ≤ 500,超限 fail-open),没有匹配后代的目录不返回。matchesAnyGlob与前缀匹配统一走 picomatch(本包既有依赖),祖先探测保留迭代式逐段 DP。packages/kap-server/test/fs.test.ts(逐层祖先遍历、通配符段、无匹配后代不显示、文件前缀不显示)与packages/agent-core-v2/test/workspace/workspaceFs/fsSearch.test.ts(段边界、深 glob 防栈溢出)新增用例。docs/{en,zh}/reference/server-api.md的fs:list参数表同步加该字段,并注明点开头路径需同时传show_hidden: true。@moonshot-ai/agent-core-v2条目(minor:新字段;patch:glob 引擎切换的行为变化)。Behavior Changes and Affected Users
fs:list请求体字段allow_ignored_globsinclude_globs/exclude_globs/allow_ignored_globs,覆盖 fs:list / fs:search / fs:suggest / fs:grep)a/**/b可匹配a/xxb;a/**不匹配a本身;foo**可跨段匹配a/**/b不再匹配a/xxb;a/**也匹配a本身;foo**不再跨段ignored-*)的被忽略目录一律显示fs:list端点(session 级)与所有使用 fs glob 字段的端点;list_many等其他端点未变。packages/kap-server/test/fs.test.ts55 个用例、packages/agent-core-v2/test/workspace/workspaceFs/100 个用例全部通过;pnpm lint0 错误、pnpm typecheck通过。.changeset/fs-list-allow-ignored-globs.md、.changeset/fs-glob-segment-boundary.md。Checklist
/approve).gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.