Repository navigation
chat: let the Agent redo the lower level of the selected card (reExpand) - #28
Merged
Merged
Conversation
…d land the new, 撤销 restores)
…n (thinking off like the app)
…o common card checks in the prompt
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.
问题
选中第 1 站、让 Agent 把已展开的 4 张 L2 卡重做成「一个 Skill 一张卡」时,Agent 看不到子卡,也只有
editRoute/startStop两种提案,于是去改了第 2、3 站,最后说做不到。改动(每步一个提交)
askNote把画布上选中的卡传给chatPrompt,选中卡优先于note.attachedTo作为「当前站」;每轮多带一段「选中卡 + 它下一层的标题和 40 字摘要」(有数量上限)。SYSTEM_TOKENS450→800(新规则的估算)。CHAT_INSTRUCTIONS新增{"proposal":{"type":"reExpand","stop":站号或卡标题,"instruction":"…"}},规则是学习者谈到选中卡的下一层/子卡/展开层时发;拿不准就先问;明确说 Agent 能重做下层。不做意图分类器。类型、zod 校验、checkProposal(站号或唯一卡标题 → 真实卡)一并加上。regenAny(被拒的卡一律重生成一次);展开上限 8→12(仅 reExpand 的 schema);landReExpand先把旧下层(含孙卡)归档到cardArchives(可恢复)再过 gate、落新卡;没有新卡落地就原样返回旧板。expand()在被别的生成占用时会 toast 而不是静默返回。测试
tsc --noEmit、tsc -p tsconfig.electron.json --noEmit、vite build:通过tests/reexpand.test.ts、tests/chat.test.ts里 reExpand 解析/校验、选中卡上下文、withProposal / restoreLinks;包含「旧子卡归档 + 新卡落地」「失败不动旧卡」)真实模型采样(zenmux · deepseek/deepseek-v4.1-flash,thinking 关闭,与 app 一致)
① 选中卡 chat(Skills 板,选中 s1 + 4 张子卡,9 句,共跑 3 遍)
② reExpand 展开(旧下层先归档,prompt 含「每个 Skill 一张」,用 landReExpand + runGate 真跑)
regenAny(3 遍,最终版)regenAny,被拒的卡走一次现有的精简重生成;并在 reExpandNote 里提醒 substance 要写进 body、check.q 要换新情境。finish_reason全是 stop,没有截断。已知限制