Add completions menu for files and folders#8
Conversation
|
will look at this first thing today; looks great! just to be clear, there are two features at play here: the @file/folder/symbol feature is a mechanism for explicitly adding content to the context (a la cursor, and others), is this that? or is this file path completion? both are great, we'd just want to switch to having the |
|
I modeled it more for the cursor like mechanism as you will see in the implementation, but since the view tool is able to pick up file paths just from the text it works like the latter for now. If needed I can add the file contents statically to the context as well. Whichever way you feel works best with the project. It can be / now and then when we add git or lsp support it can become @ with all the changes to ui that accompany adding another completion provider |
|
@Adictya this is incredible, seriously, thank you so much for going out of your way to make the codebase better. ❤️ my only two thoughts/questions:
|
|
Hey thanks a lot @adamdottv , it was a great experience. Always a joy to simplify code.
|
|
on the bubbles thing, you made the right call, and i suspected their list might not be configurable enough! your version is perfect, fits the needs of the app exactly |
|
@adamdottv Changed the initiation key to '/' |
…d dank Windows Command Execution Fixes: - Add detectCommandShell() and parseCommand() functions for shell detection - Implement direct PowerShell execution bypassing cmd.exe wrapper - Add shell built-ins detection and needsShellExecution function - Fix stream draining to prevent race conditions (Promise.all) - Remove duplicate abort listeners Edit Tool Improvements: - Add newString validation guard (handles undefined/null/empty) - Add UnicodeNormalizedReplacer for smart quotes and em-dashes - Fix multi-line pattern matching with empty lines (Issue anomalyco#26) - Add unique match identification for replaceFirst functionality - Improve block anchor matching with variable gap handling Documentation: - Add verified-fixes-summary.md documenting all fixed issues - Add windows-command-execution-issues.md comprehensive analysis - Add linux-unix-mac-compatibility-analysis.md for cross-platform impact Fixes: Issues anomalyco#2, anomalyco#3, anomalyco#4, anomalyco#5, anomalyco#7, anomalyco#8, anomalyco#9, anomalyco#15, anomalyco#19, anomalyco#26
…drock undefined messages - processor.ts: add MAX_RETRIES=10 cap to prevent infinite retry storms (Issue #1) - processor.ts: preserve metadata on tool-error state updates (Issue #8) - error.ts: handle Bedrock literal 'undefined' message for overflow detection (Issue #2) - task.ts: check result.info.error to surface subagent failures to parent (Issue #3) - test/provider/error.test.ts: 17 tests covering parseAPICallError + parseStreamError - docs/09-temp/issues.md: full RCA documentation for 9 identified issues
…odies - Refresh VCS state before idempotency check in create() to avoid TOCTOU race (anomalyco#4, anomalyco#12) - Use refreshed branch/defaultBranch in fallback PR return (anomalyco#9) - Validate base branch exists before attempting gh pr create (anomalyco#22) - Wrap review comment bodies in fenced blocks for structural separation (anomalyco#8)
* feat(opencode): add `cljfmt` formatter support for Clojure files (anomalyco#13426) * fix(website): correct zh-CN translation of proprietary terms in zen.mdx (anomalyco#13734) Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> * chore: generate * desktop: use process-wrap instead of manual job object (anomalyco#13431) * feat(opencode): Add Venice support in temperature, topP, topK and smallOption (anomalyco#13553) * feat(opencode): add conservative workspace hot reload * fix(opencode): reset caches and emit hot reload event * feat(experimental): add hot reload API trigger * chore(sdk): regenerate OpenAPI for hot reload * test(hotreload): gate darwin path alias on macOS * chore(flags): simplify hot reload gating * chore(flags): align hot reload env with experimental * feat(hotreload): emit change events and support manual mode * feat(hotreload): make reload userland-driven * chore(sdk): include hot reload changed event * feat(hotreload): reset plugins, tools, and mcp on apply * fix(cli): allow --agent with --attach * Revert "fix(cli): allow --agent with --attach" This reverts commit 7f1c77f. * fix(hotreload): apply within instance context --------- Co-authored-by: Salam Elbilig <finalfantasia@users.noreply.github.com> Co-authored-by: Pan Kaixin <pan_kaixin@qq.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> Co-authored-by: Brendan Allan <brendonovich@outlook.com> Co-authored-by: dpuyosa <dpuyosa@users.noreply.github.com> Co-authored-by: Benjamin Shafii <benjamin.shafii@gmail.com>
…odies - Refresh VCS state before idempotency check in create() to avoid TOCTOU race (anomalyco#4, anomalyco#12) - Use refreshed branch/defaultBranch in fallback PR return (anomalyco#9) - Validate base branch exists before attempting gh pr create (anomalyco#22) - Wrap review comment bodies in fenced blocks for structural separation (anomalyco#8)
…drock undefined messages - processor.ts: add MAX_RETRIES=10 cap to prevent infinite retry storms (Issue #1) - processor.ts: preserve metadata on tool-error state updates (Issue #8) - error.ts: handle Bedrock literal 'undefined' message for overflow detection (Issue #2) - task.ts: check result.info.error to surface subagent failures to parent (Issue #3) - test/provider/error.test.ts: 17 tests covering parseAPICallError + parseStreamError - docs/09-temp/issues.md: full RCA documentation for 9 identified issues
* Restructure watchdogTick so idle-detection sweeps
SessionActivity.list() independently of stuck-tool
query results — fixes Bug anomalyco#4 (idle gated behind
stuck-tool results) and Bug anomalyco#5 (leaf.length === 0
early return skipping idle detection entirely)
* Add pre-cancel map cleanup in the idle sweep to
prevent unbounded growth of stale entries
* Define CancelRequested bus event in processor and
publish from abortChildren so child sessions get
in-memory cancel alongside the DB updates (Bug anomalyco#7)
* Add SessionPrompt.init() subscribing to the event,
called from bootstrap alongside SessionActivity
* Wrap AI SDK iterator consumption in try/finally to
call iter.return() on abort, preventing leaked HTTP
connections (Bug anomalyco#8)
* Check abort signal before retry continue to stop
cancelled sessions from restarting loops (Bug anomalyco#9)
* Remove shadowed abort promise in permission-check
loop so pre-aborted signals reject immediately
instead of hanging (Bug anomalyco#10)
* Update watchdog tests for independent idle sweep
and add cancel-propagation event tests
* Restructure watchdogTick so idle-detection sweeps
SessionActivity.list() independently of stuck-tool
query results — fixes Bug anomalyco#4 (idle gated behind
stuck-tool results) and Bug anomalyco#5 (leaf.length === 0
early return skipping idle detection entirely)
* Add pre-cancel map cleanup in the idle sweep to
prevent unbounded growth of stale entries
* Define CancelRequested bus event in processor and
publish from abortChildren so child sessions get
in-memory cancel alongside the DB updates (Bug anomalyco#7)
* Add SessionPrompt.init() subscribing to the event,
called from bootstrap alongside SessionActivity
* Wrap AI SDK iterator consumption in try/finally to
call iter.return() on abort, preventing leaked HTTP
connections (Bug anomalyco#8)
* Check abort signal before retry continue to stop
cancelled sessions from restarting loops (Bug anomalyco#9)
* Remove shadowed abort promise in permission-check
loop so pre-aborted signals reject immediately
instead of hanging (Bug anomalyco#10)
* Update watchdog tests for independent idle sweep
and add cancel-propagation event tests
…lt, http://* Replace over-broad default grants with the minimum set the UI actually needs: - shell:default → shell:allow-open (only shellOpen(url) is called from the frontend — no shell:execute). - process:default → process:allow-restart (relaunch is the only usage; exit-arbitrary is not). - http:default now scopes to https://* and the loopback http origins (localhost / 127.0.0.1). Plain-HTTP arbitrary hosts are refused; users who need an insecure remote provider must opt in explicitly rather than getting it by default. - opener:allow-open-path entries with "app": true are removed; the app alias is now validated server-side (validate_open_app_name) and the `open_path` Tauri command already gates the filesystem target (validate_open_target), so the extra "app": true surface is redundant and only widened the XSS blast radius. Closes anomalyco#8/21.
Bridge was dying on startup because Hatch MCP client called tools/list before Java core finished registering capabilities. Added poll loop (max 20s) that waits for loaded_count > 0 before opening session and exec'ing bridge. Also records: MCPHUB alpha architecture rework pending (Go daemon scrap → Java-centric). Spec deviated from Proposal §4.3 'thin wrapper' intent. Post-rework, bridge connection issues #1/#3/#4/#5/anomalyco#8 are expected to be structurally eliminated. Hatch-side backlog unchanged: - HMD-03 VT-013/014: 50-turn verification (in progress) - HMD-02: deferred hack deletion (blocked on HMD-03) - anomalyco#6 websearch empty responses: Hatch adapter issue - anomalyco#7 webfetch HTML bloat: Hatch adapter issue
…滚动入视野 [feat: md-office-improvements] User 2026-05-05 第三批反馈剩余项 anomalyco#8 修复。 之前 .md 内链 [link](./other.md) 点击跳到 other.md 后,文件树没任何反应: - 没高亮新 active 文件 - 文件在折叠子目录里看不到 - 即使展开了也没滚到视野中 根因:session-side-panel.tsx "all files" FileTree 的 active prop 根本没传。 "diff" 那棵树有(line 426 active={props.activeDiff}),"all" 那棵树漏。 也没有任何"切 tab → 展开父目录"机制。 修法(联动所有切 tab 触发,不止 .md 内链): 1. createMemo activeFilePath:从 activeFileTab() 通过 file.pathFromTab 转路径 2. createEffect:activeFilePath 变化时: - 拆 path 按 / 分段,从根开始 file.tree.expand 每个父目录(idempotent, 重复 expand 已展开的目录是 no-op) - queueMicrotask:等 DOM 更新 + 父目录展开后,querySelector 找 [data-tree-path="..."] 节点 → scrollIntoView({ behavior: smooth, block: nearest }) 3. FileTree all-tab 加 active={activeFilePath()} 让节点 row 高亮 为支持 (3) 的 querySelector,file-tree.tsx FileTreeNode row 元素加 data-tree-path={local.node.path} 属性 — 1 行 additive,无回归。 文件改动 - packages/app/src/components/file-tree.tsx:+1 行(data-tree-path 属性) - packages/app/src/pages/session/session-side-panel.tsx:+24 行(activeFilePath + createEffect expand+scroll + 给 all FileTree 加 active prop) 效果: - 文件树点击文件 → 高亮(原本就有,因 onFileClick → openTab → activeFileTab 变, 但缺 active prop 没生效;现在 active 传进去 = 高亮) - .md 内链点击 → openTab(rel) → activeFileTab 变 → effect 触发 → 父目录展开 + 滚动 - 命令面板 / 任何方式切 tab → 同上联动 R4 override:无,改的都是 packages/app/(非黑名单)。 验证 - bun run typecheck:15/15 全过(1.263s) - DeskFox.exe build:34.74 MB / 1m09s / exit 0 - 等 user runtime 测内链跳转 + 文件树焦点同步
… reproducer context Code Reviewer subagent (fresh-context, with codebase access) flagged: - AI SDK line ref off by 18 (~L6283 → L6265 in ai@6.0.158, the resolved version per node_modules symlink) - Quirks anomalyco#3/anomalyco#6/anomalyco#7/anomalyco#8 not in transform.ts as the opener implied (anomalyco#7 in processor.ts, anomalyco#8 in llm.ts, anomalyco#6 in provider discovery) - "Two full days" / "every quirk within an hour" framing reads as venting to a PM audience; strip - Asks anomalyco#3+anomalyco#4 should be merged into one Responses-API-parity workstream - Reference-client ask should be #2 (highest-leverage deliverable) - Missing reproducer context: package versions, endpoint name Apply all of the above. Add direct GitHub links from the SDK-package quirks to upstream source lines and from the workaround text to llm.ts:407–461 so internal recipients can hand off to the SDK-package team without re-reading this doc. Add a versions-tested header. Co-authored-by: Isaac
…lt, http://* Replace over-broad default grants with the minimum set the UI actually needs: - shell:default → shell:allow-open (only shellOpen(url) is called from the frontend — no shell:execute). - process:default → process:allow-restart (relaunch is the only usage; exit-arbitrary is not). - http:default now scopes to https://* and the loopback http origins (localhost / 127.0.0.1). Plain-HTTP arbitrary hosts are refused; users who need an insecure remote provider must opt in explicitly rather than getting it by default. - opener:allow-open-path entries with "app": true are removed; the app alias is now validated server-side (validate_open_app_name) and the `open_path` Tauri command already gates the filesystem target (validate_open_target), so the extra "app": true surface is redundant and only widened the XSS blast radius. Closes anomalyco#8/21.
…xTools cap Add script/probe-aigw-quirks.ts — a reproducible per-family test of every catalogued quirk against AI Gateway, run once and committed so future sessions can re-verify in seconds. Replaces the partly-inferred AI Gateway status column with on-the-wire evidence. Findings (running against the aigw workspace, Claude / GPT / Gemini where applicable): #1 schema strict — STILL ACTIVE on all 3 families (server-side, harmless to opencode because our adapters generate proper schemas) #2/anomalyco#11 oversized itemId — STILL ACTIVE (GPT only) anomalyco#3 asymmetric streaming events — GONE (perfectly symmetric on aigw) anomalyco#4 reasoning_effort — works correctly (reasoning_tokens returned) anomalyco#5 cache_control — works correctly (verified with two-call populate+hit test; my earlier "fail" reading was a 1212-token prompt under the effective cache threshold) anomalyco#6 task=null on Codex/GPT-5 metadata — GONE (all 3 families now return task: "llm/v1/chat" correctly) anomalyco#7 finish_reason "other" — STILL ACTIVE (GPT) anomalyco#8 per-endpoint 89-tool cap — GONE on AI Gateway (verified all 3 families accept 89 tools; cap was a model-serving constraint) anomalyco#9, anomalyco#10 npm package lifecycle bugs — INERT on AI Gateway (we use @ai-sdk/openai, bundled provider not loaded) anomalyco#12 mismatched item IDs — STILL ACTIVE (GPT) Net: of 12 quirks, 4 still bite on AI Gateway (#1, #2/anomalyco#11, anomalyco#7, anomalyco#12), 4 are gone (anomalyco#3, anomalyco#6, anomalyco#8, plus anomalyco#4 always worked), anomalyco#5 works correctly, and 2 are bypassed by adapter choice. Anthropic and Gemini paths through @ai-sdk/anthropic and @ai-sdk/google are clean on AI Gateway. Code change consequence: drop the maxTools: 16 cap in familyDefaults for gpt/codex when on the AI Gateway path (anomalyco#8 is gone there). Cap stays on the model-serving path. 3-class regression test passes 3/3 on both surfaces after the change. Doc: replace the inferred AI Gateway status column with the empirical matrix, citing the probe script and the specific evidence per quirk. Co-authored-by: Isaac
…os for every quirk Every claim in the feedback doc is now backed by a self-contained reproduction: curl commands for the on-the-wire bugs (#1, #2/anomalyco#11, anomalyco#3, anomalyco#5, anomalyco#6, anomalyco#7, anomalyco#8, anomalyco#12) and a small Node script for the in-package bugs (anomalyco#9/anomalyco#10). PM-team recipients only need a Databricks token; no opencode checkout required. Also link the new doc from the main feedback markdown so anyone who opens the PDF sees the standalone-repro path right after the versions-tested header. Co-authored-by: Isaac
…yout Batch fix for issues found in the user's workflow session: 1. **Master not woken on final node.completed (anomalyco#7)**. The wake subscriber at workflow/index.ts:1820 dropped ALL wakes when workflow was in a terminal state. The user reported the FIRST nodes wake master fine, but the LAST node's completion races with the master's `workflow_finalize` call — by the time the node.completed event hits the subscriber, workflow.status is already "completed" and the wake gets silently dropped. Now "signal" kinds (node.completed / failed / interrupted / attempt_reported / budget_exceeded / stalled / checkpoint.*) ALWAYS wake master regardless of workflow status; chrome kinds (wake_*, pulled, command_acked, graph.edit.*) still drop on terminal so we don't wake forever. 2. **Session compaction silent failure (anomalyco#8)**. compaction.ts only published `session.compacted` on success — failure paths only set `message.error` on the last assistant message which was invisible unless the user scrolled back. The session just "froze" with no indication. Added a new `session.compaction_failed` bus event, wired the frontend event-reducer to park it on a new `sessionError[sessionID]` slot, and the workflow chat panel now appends a system message banner (`⚠ 会话压缩失败:…`) with actionable guidance (new session, bigger model context window). Successful re-compaction clears the banner. 3. **Question dialog deadlock in node sessions (anomalyco#9)**. Frontend polling for /question and /permission was gated on `status() === "running"` — but a sub-agent calling question() transitions to idle BEFORE the master picks it up, so polling stopped and the dialog never appeared, locking the session. Removed the gate; polling runs unconditionally every 2s now (cheap, returns [] when empty). 4. **Per-task node-card state leak (anomalyco#4)**. `workflowOpenTabs` was a global array — opening a node card under Task A left it visible after switching to Task B. Re-keyed by sessionId (now `Record<sessionID, OpenTab[]>`). Substrip render reads `workflowOpenTabs[params.id]`, opens/closes write through the current sessionId. Switching tasks now shows that task's own opened tabs. 5. **Refiner merge button no-op (anomalyco#1)**. Merge button was reading `selectedIds()` but the actual list-level multi-select bound to `mergeIDs` (a separate signal used by the MergeTray). Header button now reads/writes the same `mergeIDs` set the list uses, so shift-click selection -> merge button enable -> merge action all flow through one state. 6. **Refiner search input only takes one char per keystroke (anomalyco#11)**. The two search `<input>`s (line ~3815 and ~6107 of refiner-page) were missing `onCompositionStart/End` handlers. Chinese pinyin IME fires intermediate input events during composition; the controlled signal update reset the input every keystroke, breaking multi-char input. Added composition tracking that suppresses setQuery() while composing. 7. **Node-session layout (anomalyco#5)**. The outer `<div className="flex h-full flex-col">` of NodeSessionView had no horizontal sizing — `flex-col` parent's `flex-1` granted vertical grow but not width fill. Result: chat collapsed to content width, plugin slot didn't reach right edge, splitbar drag moved the whole right column left instead of resizing chat. Adding `w-full min-w-0 flex-1` to the root + `w-full min-w-0` to the body row fixes all three symptoms (whitespace left, narrow right, drag misbehavior). 8. **Rail overflow with many tasks (anomalyco#10)**. `.rune-rail-sec` had no `overflow-y: auto` or flex sizing — task list pushed beyond viewport when >N tasks. Set `flex: 1 1 auto; min-height: 0; overflow-y: auto` so the section scrolls independently while the rail brand / footer stay anchored. Not addressed in this batch (deferred for separate discussion): - Bug 2 / Bug 3 (action-budget architecture): structural change - Bug 6 (context limit on node create): largely covered by the earlier workflow_read trim; ship and observe. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Demo:

Adds completions menu for files and folders. You can press "@" to bring this up and fuzzy find any file in the working directory.
Built to be extensible so we can add more providers for things like git, lsp symbols etc given we also build the tools.
Adds a minimal reusable list component since I had found myself reusing a lot of code from commands dialog.
Let me know if this looks good and if the ux feels good and if its line with what you guys think this feature should look like. Also feel free to be as pedantic as you want, I want to strictly adhere to the repo coding style so if any naming/folder convention doesn't match or if any variable name is not ideal.