Skip to content

Add completions menu for files and folders#8

Merged
adamdotdevin merged 4 commits intoanomalyco:devfrom
Adictya:feat-completion-menu-for-file-paths
May 15, 2025
Merged

Add completions menu for files and folders#8
adamdotdevin merged 4 commits intoanomalyco:devfrom
Adictya:feat-completion-menu-for-file-paths

Conversation

@Adictya
Copy link
Copy Markdown
Contributor

@Adictya Adictya commented May 15, 2025

Demo:
pr-demo-sst

  • 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.

@adamdotdevin
Copy link
Copy Markdown
Member

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 / character initiate it if it's the latter.

@Adictya
Copy link
Copy Markdown
Contributor Author

Adictya commented May 15, 2025

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

@adamdotdevin
Copy link
Copy Markdown
Member

@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:

  • bubbletea "bubbles" has a list component, does it accomplish the same thing as the simple-list component? fwiw, i'm not opposed to having this in the opencode repo, it works great, just wanted to see if you had considered using it and if there were tradeoffs.
  • the @ vs / thing; i'd really like to fast follow this PR (happy to help) with a PR to enable the @ feature in whole, where you can @ a file/folder/symbol (we've got an LSP workspaceSymbols tool now that forms the basis for looking up symbols). i think having both features is where we want to land, so i'm inclined to have you switch the trigger to / for this feature, and then work on the second (@). related, i also want to have / commands as a concept, maybe replacing the command palette or supplementing; could extend this file path completion to also include commands (like claude code). all of that is outside the scope of this PR, just bringing it up for context.

@Adictya
Copy link
Copy Markdown
Contributor Author

Adictya commented May 15, 2025

Hey thanks a lot @adamdottv , it was a great experience. Always a joy to simplify code.

  • For the list thing, yes I did consider it I read through the source code of the list component even and the bubbletea file picker component as well and these were the first things I tried using for the dialog but its too opinionated on its styling of list elements and the feature set it provides. I then looked at how other parts of the code were doing it and concluded that this must be the reason other components opted out of it. Extremely open to suggestions if you wanna take a look and see if simple list is still better, happy to change the implementation.

  • Makes sense, I can follow up with the pr for that and the command thing . And for now switch this to /.

@adamdotdevin
Copy link
Copy Markdown
Member

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

@Adictya
Copy link
Copy Markdown
Contributor Author

Adictya commented May 15, 2025

@adamdottv Changed the initiation key to '/'

@adamdotdevin adamdotdevin merged commit a203fb8 into anomalyco:dev May 15, 2025
burgercrisis added a commit to burgercrisis/opencode that referenced this pull request Jan 8, 2026
…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
praxstack referenced this pull request in praxstack/opencode Feb 25, 2026
…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
tamarazuk added a commit to tamarazuk/opencode that referenced this pull request Mar 3, 2026
…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)
nolouch pushed a commit to nolouch/opencode that referenced this pull request Mar 13, 2026
* 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>
tamarazuk added a commit to tamarazuk/opencode that referenced this pull request Mar 21, 2026
…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)
imgbot Bot referenced this pull request in praxstack/opencode Mar 24, 2026
…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
ESRE-dev added a commit to ESRE-dev/opencode that referenced this pull request Mar 27, 2026
    * 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
ESRE-dev added a commit to ESRE-dev/opencode that referenced this pull request Mar 27, 2026
    * 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
Rwanbt added a commit to Rwanbt/opencode that referenced this pull request Apr 19, 2026
…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.
sorted-ai-bot pushed a commit to sorted-ai/opencode that referenced this pull request Apr 25, 2026
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/anomalyco#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
zoulukuang pushed a commit to zoulukuang/deskfox that referenced this pull request May 5, 2026
…滚动入视野 [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 测内链跳转 + 文件树焦点同步
dgokeeffe pushed a commit to dgokeeffe/opencode-databricks that referenced this pull request May 5, 2026
… 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
Rwanbt added a commit to Rwanbt/opencode that referenced this pull request May 5, 2026
…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.
dgokeeffe pushed a commit to dgokeeffe/opencode-databricks that referenced this pull request May 6, 2026
…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
dgokeeffe pushed a commit to dgokeeffe/opencode-databricks that referenced this pull request May 6, 2026
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants