fix: bump pctx_code_mode to 0.3.0 for iterator type checking fix#7892
Conversation
pctx_code_mode 0.2.3 depends on pctx_type_check_runtime 0.1.2, which
uses a minimal lib.d.ts without ES2015 iterable definitions. This
causes the TypeScript type checker to reject valid `for...of` loops
on arrays with TS2488 ("Type '{}' must have a '[Symbol.iterator]()'
method"), even though arrays are iterable at runtime.
pctx_code_mode 0.3.0 depends on pctx_type_check_runtime 0.1.3, which
includes full ES2020+ lib files (including lib.es2015.iterable.d.ts),
fixing the false-positive type errors.
This was causing execute tool calls with `for...of` loops to fail type
checking and abort before execution, forcing the model to fall back to
individual tool calls instead of batched operations.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Clyde <clyde@Clydes-Mac-Studio.local>
Signed-off-by: Dale Lakes <6843636+spitfire55@users.noreply.github.com>
03e04e2 to
b40cbe5
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 03e04e2153
ℹ️ 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".
| tree-sitter-typescript = { workspace = true } | ||
| which = { workspace = true } | ||
| pctx_code_mode = { version = "^0.2.3", optional = true } | ||
| pctx_code_mode = { version = "^0.3.0", optional = true } |
There was a problem hiding this comment.
Regenerate Cargo.lock after bumping pctx_code_mode
This manifest change alone does not update the repository’s resolved dependency set: in this revision, Cargo.lock still pins pctx_code_mode to 0.2.3 (and pctx_type_check_runtime to 0.1.2), so the intended type-checking fix is not actually captured in committed sources that rely on the lockfile; in lockfile-driven/frozen build contexts, this either keeps the old behavior or fails because the lock is stale.
Useful? React with 👍 / 👎.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Dale Lakes <6843636+spitfire55@users.noreply.github.com>
pctx_code_mode 0.3.0 restructured its public API: - CallbackRegistry -> registry::PctxRegistry - CallbackFn -> registry::CallbackFn - registry.add() -> registry.add_callback() - code_mode.execute() -> code_mode.execute_typescript() with ToolDisclosure - CallbackConfig.namespace: String -> Option<String> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Dale Lakes <6843636+spitfire55@users.noreply.github.com>
…oken-retry * origin/main: (21 commits) Remove java/.ai-usage-marker directory (#7925) test(acp): add terminal delegation fixtures and fix shell singleton (#7923) fix: bump pctx_code_mode to 0.3.0 for iterator type checking fix (#7892) feat: persist GooseMode per-session via session DB (#7854) feat(otel): propagate session.id to spans and log records (#7490) fix(test): add env_lock to is_openai_reasoning_model tests (#7917) fix(acp): pass session_id when loading extensions so skills are discovered (#7868) updated canonical models (#7920) feat(autovisualiser): Migrate the autovisualiser extension to MCP Apps (#7852) fix: add tool_choice and parallel_tool_calls to chatgpt_codex provider (#7867) fix: tool confirmation handling for multiple requests (#7856) Remove dead OllamaSetup onboarding flow (#7861) fix: resolve tokio::sync::Mutex deadlock in recipe retry path (#7832) Upgrade Electron 40.6.0 → 41.0.0 (#7851) Only show up to 50 lines of source code (#7578) fix: stop writing without error when hitting broken pipe for goose session list (#7858) feat(acp): add session/set_mode handler (#7801) Keep messages in sync (#7850) More acp tools (#7843) fix: skip upgrade-insecure-requests CSP for external HTTP backends (#7714) ...
* origin/main: (72 commits) No Check do Check (#7942) Log 500 errors and also show error for direct download (#7936) fix: retry on authentication failure with credential refresh (#7812) Remove java/.ai-usage-marker directory (#7925) test(acp): add terminal delegation fixtures and fix shell singleton (#7923) fix: bump pctx_code_mode to 0.3.0 for iterator type checking fix (#7892) feat: persist GooseMode per-session via session DB (#7854) feat(otel): propagate session.id to spans and log records (#7490) fix(test): add env_lock to is_openai_reasoning_model tests (#7917) fix(acp): pass session_id when loading extensions so skills are discovered (#7868) updated canonical models (#7920) feat(autovisualiser): Migrate the autovisualiser extension to MCP Apps (#7852) fix: add tool_choice and parallel_tool_calls to chatgpt_codex provider (#7867) fix: tool confirmation handling for multiple requests (#7856) Remove dead OllamaSetup onboarding flow (#7861) fix: resolve tokio::sync::Mutex deadlock in recipe retry path (#7832) Upgrade Electron 40.6.0 → 41.0.0 (#7851) Only show up to 50 lines of source code (#7578) fix: stop writing without error when hitting broken pipe for goose session list (#7858) feat(acp): add session/set_mode handler (#7801) ...
* main: Add DCO git commit command to AGENTS.md (#7945) fix(claude-code): remove incorrect agent_visible filter on user message (#7931) No Check do Check (#7942) Log 500 errors and also show error for direct download (#7936) fix: retry on authentication failure with credential refresh (#7812) Remove java/.ai-usage-marker directory (#7925) test(acp): add terminal delegation fixtures and fix shell singleton (#7923) fix: bump pctx_code_mode to 0.3.0 for iterator type checking fix (#7892) feat: persist GooseMode per-session via session DB (#7854) feat(otel): propagate session.id to spans and log records (#7490) fix(test): add env_lock to is_openai_reasoning_model tests (#7917) fix(acp): pass session_id when loading extensions so skills are discovered (#7868)
* origin/main: feat: adversarial agent for preventing leaking of info and more (#7948) Update contributing.md (#7927) docs: add credit balance monitoring section (#7952) docs: add Cerebras provider to supported providers list (#7953) docs: add TUI client documentation to ACP clients guide (#7950) fix: removed double dash in pnpm command (#7951) docs: polish ACP docs (#7946) claude adaptive thinking (#7944) feat: new onboarding flow (#7266) Add DCO git commit command to AGENTS.md (#7945) fix(claude-code): remove incorrect agent_visible filter on user message (#7931) No Check do Check (#7942) Log 500 errors and also show error for direct download (#7936) fix: retry on authentication failure with credential refresh (#7812) Remove java/.ai-usage-marker directory (#7925) test(acp): add terminal delegation fixtures and fix shell singleton (#7923) fix: bump pctx_code_mode to 0.3.0 for iterator type checking fix (#7892) feat: persist GooseMode per-session via session DB (#7854)
Summary
pctx_code_modefrom^0.2.3to^0.3.0executetool calls withfor...ofloops to failProblem
The
executetool uses pctx's TypeScript type checker before running code. Withpctx_code_mode0.2.3 (which depends onpctx_type_check_runtime0.1.2), the type checker uses a minimallib.d.tsthat doesn't include ES2015 iterable definitions (lib.es2015.iterable.d.ts).This means any code using
for...ofon an array fails type checking with:Even though arrays are perfectly iterable at runtime. When this happens, the execute tool aborts before execution, and the model has to fall back to making individual tool calls instead of batched operations.
Example of valid code that fails:
Fix
pctx_code_mode0.3.0 depends onpctx_type_check_runtime0.1.3, which includes full ES2020+ lib files (includinglib.es2015.iterable.d.ts). This was fixed upstream in portofcontext/pctx@db67183 ("include ts lib deps as part of type checking").Test plan
executetool calls withfor...ofloops no longer fail type checking🤖 Generated with Claude Code