Skip to content

No toasts, and no functional semantic searching #2

Closed

Description

@draxxris
  1. There seems to be some sort of toast support to notify the user when something is awry, but I am not getting any in the TUI.
  2. Searching is enabled in aft.jsonc and onnx is installed in /usr/local/lib, but aft_search is still not available

Is there anymore debugging available? Running opencode through strace, I don't see attempts to access anything "*onnx*" at all, but its possible strace -f didn't follow thru to the aft binary.

ls -1 /usr/local/lib/libonnx* ; echo; \
grep \"experimental ~/.config/opencode/aft.jsonc ; echo; \
pgrep -f aft && echo "AFT IS RUNNING"; echo; \
pgrep -f opencode && echo "OPENCODE IS RUNNING"
/usr/local/lib/libonnxruntime.so
/usr/local/lib/libonnxruntime.so.1
/usr/local/lib/libonnxruntime.so.1.24.4
/usr/local/lib/libonnxruntime_providers_shared.so

  "experimental_search_index": true,
  "experimental_semantic_search": true,

611718
AFT IS RUNNING

611603
OPENCODE IS RUNNING
Image

Activity

  1. ualtinok commented on Apr 10, 2026

    @ualtinok
    Collaborator

    Could you run:

    bunx @cortexkit/aft-opencode@latest doctor

    or even better open new issue with, which will include all the needed information:

    bunx @cortexkit/aft-opencode@latest doctor --issue

  2. draxxris commented on Apr 10, 2026

    @draxxris
    Author

    I installed the package by just putting it in the plugins stanza of opencode.jsonc, not bunx. Regardless, I waddled through it and got further, but it still non-functional:

    1. opencode's plugin stanza had @latest in the entry for AFT, but it wasn't actually pulling the latest, it was still on 0.9.x -- I had to explicitly tag a version to 0.11.x (doctor wasn't a valid command in 0.9.x)
    2. I did not have bunx; installed via mise, then ran: cd ~/.cache/opencode && bunx @cortexkit/aft-opencode@latest doctor it discovered many issues.
      a. Download the binary ONNX tarball from https://github.com/microsoft/onnxruntime/releases/tag/v1.24.4
      b. the .so files were not installed properly, sudo ldconfig had to be run after moving them manually into /usr/local/lib
      c. the aft cache had to be deleted: -rf ~/.cache/aft/bin/v0.9.1

    The aft binary is now crashing (for at least aft_outline and ast_grep_search):

    Thinking: The user wants me to use aft_outline on the python/rt_yaml package. Let me do that.
    ⚙ aft_outline [filePath=python/rt_yaml]
    [aft-plugin] Binary crashed (restarts: 0)
    

    It can be run manually:

    > cd ~/.cache/opencode
    > ./node_modules/@cortexkit/aft-linux-x64/bin/aft
    [aft] started, pid 811218
    
  3. ualtinok commented on Apr 11, 2026

    @ualtinok
    Collaborator

    Yes unfortunately opencode caches plugins aggressively. I think the issue is still onxx runtime. If that's the only problem aft_outline should work properly when you disable experimental_semantic_search. Before doing that, can you try this:

    RUST_BACKTRACE=1 ~/.cache/aft/bin/v0.11.1/aft <<'EOF'
    {"id":"1","command":"configure","params":{"project_root":"/path/to/your/project"}}
    {"id":"2","command":"outline","params":{"directory":"python/rt_yaml"}}
    EOF
    

    This should give us more detail about the crash and also if possible please check doctor output to see where the logs are and paste here the last 50 lines when that crash happens.

    Thanks

  4. draxxris commented on Apr 12, 2026

    @draxxris
    Author

    First terminal

    > while true; do sudo strace -f -o /tmp/strace.out -p $(pgrep aft) && break; done
    ...
    strace: Process 1205882 attached with 4 threads
    
    > cat /tmp/strace.out
    1205892 +++ killed by SIGABRT (core dumped) +++
    1205889 +++ killed by SIGABRT (core dumped) +++
    1205893 +++ killed by SIGABRT (core dumped) +++
    1205882 +++ killed by SIGABRT (core dumped) +++
    

    Second terminal

    > export RUST_BACKTRACE=full
    > opencode
    
    "run aft_outline on cmd/game/main.go"
    
    ...
    
    Thinking: ... aft_outline [filePath=cmd/game/main.go]
    [aft-plugin] Binary crashed
    

    Third terminal

    > RUST_BACKTRACE=1 ~/.cache/aft/bin/v0.11.1/aft <<EOF
    {"id":"1","command":"configure","params":{"project_root":"$PWD"}}
    {"id":"2","command":"outline","params":{"file":"cmd/game/main.go"}}
    EOF
    [aft] started, pid 1210110
    {"id":"1","success":false,"code":"invalid_request","message":"configure: missing required param 'project_root'"}
    {"id":"2","success":false,"code":"invalid_request","message":"outline: missing required param 'file' or 'files'"}
    [aft] stdin closed, shutting down
    
    > echo $?
    0
    

    Fourth terminal

    > env -C ~/.cache/opencode bunx @cortexkit/aft-opencode@latest doctor
    ┌  AFT Doctor
    │
    ◆  OpenCode installed (1.4.3)
    │
    ●  Config dir: /home/USER/.config/opencode
    │
    ●  OpenCode config: /home/USER/.config/opencode/opencode.jsonc (jsonc)
    │
    ●  AFT config: /home/USER/.config/opencode/aft.jsonc (jsonc)
    │
    ●  TUI config: /home/USER/.config/opencode/tui.jsonc (jsonc)
    │
    ◆  OpenCode config already includes AFT
    │
    ◆  TUI plugin entry configured
    │
    ◆  Plugin cache is up to date (0.11.1)
    │
    ◆  AFT config loaded: hoist_builtin_tools=true, format_on_edit=false, validate_on_edit="syntax", tool_surface="all", disabled_tools=[], experimental_search_index=true, experimental_semantic_search=true, restrict_to_project_root=true
    │
    ◆  Binary cache active version: v0.11.1 (24.3 MB)
    │
    ◆  ONNX Runtime found at /usr/local/lib
    │
    ●  Storage: index=729.8 KB, semantic=172.4 MB, backups=0 B, url_cache=0 B, onnxruntime=0 B
    │
    ●  Log file: /tmp/aft-plugin.log (55 KB)
    │
    └  Everything looks good
    

    Fifth terminal

    > cat /tmp/aft-plugin.log
    ...
    [2026-04-12T01:10:21.044Z] INFO [aft-plugin] [aft] started, pid 1226111
    [2026-04-12T01:10:21.065Z] INFO [aft-plugin] [aft] [aft] search index: refreshed 1 stale file(s) from disk cache
    [2026-04-12T01:10:21.071Z] INFO [aft-plugin] [aft] 
    [2026-04-12T01:10:21.071Z] INFO [aft-plugin] [aft] thread '<unnamed>' (1226116) panicked at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ort-2.0.0-rc.11/src/lib.rs:191:41:
    [2026-04-12T01:10:21.071Z] INFO [aft-plugin] [aft] Failed to load ONNX Runtime dylib: Error { code: GenericFailure, msg: "failed to load from `/usr/local/lib/libonnxruntime.so`: dlopen failed" }
    [2026-04-12T01:10:21.071Z] INFO [aft-plugin] [aft] stack backtrace:
    [2026-04-12T01:10:21.072Z] INFO [aft-plugin] [aft]    0:     0x7fd6e3759902 - <unknown>
    [2026-04-12T01:10:21.072Z] INFO [aft-plugin] [aft]    1:     0x7fd6e354029a - <unknown>
    [2026-04-12T01:10:21.072Z] INFO [aft-plugin] [aft]    2:     0x7fd6e3759015 - <unknown>
    [2026-04-12T01:10:21.072Z] INFO [aft-plugin] [aft]    3:     0x7fd6e3758e27 - <unknown>
    [2026-04-12T01:10:21.072Z] INFO [aft-plugin] [aft]    4:     0x7fd6e377ceb7 - <unknown>
    [2026-04-12T01:10:21.072Z] INFO [aft-plugin] [aft]    5:     0x7fd6e377ce69 - <unknown>
    [2026-04-12T01:10:21.072Z] INFO [aft-plugin] [aft]    6:     0x7fd6e377ce5c - <unknown>
    [2026-04-12T01:10:21.072Z] INFO [aft-plugin] [aft]    7:     0x7fd6e329c14b - <unknown>
    [2026-04-12T01:10:21.072Z] INFO [aft-plugin] [aft]    8:     0x7fd6e329c481 - <unknown>
    [2026-04-12T01:10:21.072Z] INFO [aft-plugin] [aft]    9:     0x7fd6e32a431a - <unknown>
    [2026-04-12T01:10:21.072Z] INFO [aft-plugin] [aft]   10:     0x7fd6e32a4148 - <unknown>
    [2026-04-12T01:10:21.072Z] INFO [aft-plugin] [aft]   11:     0x7fd6e32b6777 - <unknown>
    [2026-04-12T01:10:21.072Z] INFO [aft-plugin] [aft]   12:     0x7fd6e32a4103 - <unknown>
    [2026-04-12T01:10:21.072Z] INFO [aft-plugin] [aft]   13:     0x7fd6e363476d -
    [2026-04-12T01:10:21.072Z] INFO [aft-plugin] [aft] <unknown>
    [2026-04-12T01:10:21.072Z] INFO [aft-plugin] [aft]   14:     0x7fd6e35ba275 - <unknown>
    [2026-04-12T01:10:21.072Z] INFO [aft-plugin] [aft]   15:     0x7fd6e331178a - <unknown>
    [2026-04-12T01:10:21.072Z] INFO [aft-plugin] [aft]   16:     0x7fd6e34f68ae - <unknown>
    [2026-04-12T01:10:21.072Z] INFO [aft-plugin] [aft]   17:     0x7fd6e34f6457 - <unknown>
    [2026-04-12T01:10:21.072Z] INFO [aft-plugin] [aft]   18:     0x7fd6e3788d28 - <unknown>
    [2026-04-12T01:10:21.181Z] INFO [aft-plugin] Process exited: code=null, signal=SIGABRT
    [2026-04-12T01:10:21.181Z] INFO [aft-plugin] Auto-restart #1 in 100ms
    
  5. ualtinok commented on Apr 12, 2026

    @ualtinok
    Collaborator

    This is the same crash as #4 — the ort crate panics at lib.rs:191 when dlopen fails on an incompatible libonnxruntime.so, and v0.11.1's panic = "abort" turns that into a SIGABRT that kills the entire binary (not just semantic search).

    Fixed in v0.11.2 (just released). Two layers of protection:

    1. pre_validate_onnx_runtime() — raw dlopen probe catches broken .so files before ort touches them. Semantic search degrades gracefully instead of crashing.
    2. panic = "unwind" in release profile — catch_unwind now works as a safety net.

    To update:

    # Clear stale plugin cache
    rm -rf ~/.cache/opencode/packages/@cortexkit
    
    # Restart OpenCode — it will pull v0.11.2

    After restart, all tools (aft_outline, ast_grep_search, etc.) should work even if the ONNX Runtime at /usr/local/lib is incompatible. Semantic search will be disabled with a logged message instead of crashing.

    About the ONNX Runtime itself:
    Your doctor shows ONNX Runtime found at /usr/local/lib but the binary can't load it. The v0.11.2 doctor now does version-aware checking — run bunx @cortexkit/aft-opencode@latest doctor after updating and it will tell you if the version is incompatible and suggest the fix (usually: remove the old .so and let AFT auto-download v1.24.4).

    Also noting: your direct binary test used "project_root" inside "params" but AFT expects project_root at the top level of the JSON object, not nested — that's why it returned missing required param. The plugin handles this translation automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions