[bug]: @sf-agentscript/lsp-server@2.2.30 crashes at startup — variantMatch is not a function (stale @sf-agentscript/language pin)
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 52/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 冷清
- 技术栈
- node.js, typescript
调研方向
先从 @sf-agentscript/agentforce-dialect、@sf-agentscript/lsp 和 @sf-agentscript/lsp-server 的依赖声明开始,然后查看 #72 中提出的发布后导入 smoke test。使用 npx --yes @sf-agentscript/lsp-server --stdio 重现,并验证全新安装能够完成 LSP initialize handshake 并发布 diagnostics。
由索引模型根据 Issue 内容生成。
描述
Description
The published @sf-agentscript/lsp-server (2.2.30, currently latest) crashes
at startup with TypeError: ...variantMatch is not a function, before the LSP
connection is established. The root cause is a stale exact pin on the transitive
@sf-agentscript/language dependency, so no fresh install of the LSP server
works (same for @sf-agentscript/lsp@2.3.8).
Steps to Reproduce
npx --yes @sf-agentscript/lsp-server --stdio
(ornpm install -g @sf-agentscript/lsp-serverand runagentscript-lsp --stdio)- The process throws immediately, before any LSP handshake.
Expected Behavior
The server starts, completes the LSP initialize handshake, and publishes
diagnostics.
Actual Behavior
Immediate crash at import:
.../@sf-agentscript/agentforce-dialect/dist/schema.js:217
.variantMatch('byon', (value) => value.startsWith(BYON_SCHEMA_PREFIX), byonSubagentVariant);
^
TypeError: NamedBlock(...).describe(...).discriminant(...).variant(...).variantMatch is not a function
Cause: @sf-agentscript/agentforce-dialect@2.13.4 (published 2026-06-10)
uses the variantMatch schema-builder API but pins
@sf-agentscript/language@2.5.4 (2026-06-01), which predates that API.
variantMatch first shipped in @sf-agentscript/language@2.8.4 (2026-06-11,
one day after the dialect) — the dialect appears to have been built against
the unreleased workspace version of language and published with a stale exact
pin. Because every @sf-agentscript/* dependency is an exact pin, no fresh
install can resolve a working language.
Fix: republish agentforce-dialect / lsp / lsp-server against
@sf-agentscript/language >= 2.8.4 (current train is 2.19.3).
Environment
- Node.js version: 22.18.0
- pnpm version: n/a (reproduced with npm / npx)
- OS: Windows 11 (also reproduced in the
node:22-bookwormcontainer) - Package & version:
@sf-agentscript/lsp-server2.2.30 (also@sf-agentscript/lsp2.3.8) - Browser (if applicable): n/a
Minimal Reproduction
The crash happens before any .agent source is read, so no snippet is required —
just running the server reproduces it:
npx --yes @sf-agentscript/lsp-server --stdio
Verified workaround — install with an npm overrides fix, after which the
server initializes and publishes diagnostics normally (verified against
Neovim's LSP client on Node 22):
{
"dependencies": { "@sf-agentscript/lsp-server": "2.2.30" },
"overrides": { "@sf-agentscript/language": "2.8.4" }
}
Additional Context
This is the same publish-pipeline defect already reported for a sibling package
in #71 (@sf-agentscript/agentforce unusable for the same reason, different
missing symbol), and the earlier #35 / #40 scope-rewrite incident. The
post-publish import smoke test proposed in #72 would have caught this too.
- 主要语言
- TypeScript
- 星标
- 267
- 派生
- 54
- 平均合并
- 48 分钟
- 30 天内合并 PR
- 1
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
salesforce/agentscript 的其他 Issue
-
README Quick Start fails on macOS: Node 26 incompatibility and missing tree-sitter CLI prerequisite 未关闭
难度 2/5 半天 新手友好度 75/100
salesforce/agentscript#33 · 2 条评论 ·
-
难度 3/5 1-2 天 新手友好度 55/100
salesforce/agentscript#71 · 1 条评论 ·
-
bug
难度 3/5 1-2 天 新手友好度 35/100
salesforce/agentscript#67 ·
-
难度 3/5 1-2 天 新手友好度 52/100
salesforce/agentscript#42 · 1 条评论 ·
-
bug
难度 3/5 1-2 天 新手友好度 72/100
salesforce/agentscript#35 · 1 条评论 ·
查看 salesforce/agentscript 的全部 Issue
相似的 Issue
-
VerificationGate: ATTRIBUTION quote guard never matches a normal quotation (\b around the quote) 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
danielmiessler/LifeOS#2234 ·
-
T: Bug
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 65/100
-
难度 1/5 1 小时以内 新手友好度 85/100
-
Mend: dependency security vulnerability untriaged
难度 2/5 1-3 小时 新手友好度 70/100