Skip to content

Conversation

@sudo-tee
Copy link
Owner

@sudo-tee sudo-tee commented Oct 12, 2025

Introduces an incremental rendering that updates only the changed portion(s) of the buffer instead of re-rendering everything on every change. This reduces CPU usages for large sessions.

This PR also incorporate a functional test suite in tests/manual where you can record a run snapshot tests.

@cameronr
Copy link
Collaborator

cameronr commented Oct 12, 2025

Comment moved to #54 (comment)

@cameronr cameronr force-pushed the feat/incremental-rendering branch from d9c91d7 to 63eae17 Compare October 12, 2025 22:53
@sudo-tee
Copy link
Owner Author

sudo-tee commented Oct 13, 2025

@cameronr

First of all great job I had the chance to play a little bit with your PR and it's coming along pretty nicely

I have a couple of commits on my branch named the same as yours for the PR but I cannot get them to show on this PR. There must be something I do wrong, or maybe I need access to the branch on your repo.

You should be able to rebase them without issues as they don't touch the streaming part.

I will be out for a couples of days so might not have to much time keeping an eye on the progress.

Keep up the good work on this. It's gonna be great.

Thanks again

@cameronr
Copy link
Collaborator

No worries, I'll pull those changes in.

Glad to hear it's looking good! I'm having fun so I'll keep chipping away at it.

ps: you might want to update the @ as my handle has an r at the end... or maybe cameron wants to join in :)

@cameron
Copy link

cameron commented Oct 13, 2025

eMacs4lyfe

@cameronr cameronr force-pushed the feat/incremental-rendering branch from 7c0f1e1 to 25c5e10 Compare October 14, 2025 00:49
@sudo-tee
Copy link
Owner Author

@cameronr

I've added new commits to render the selected text and also to unify the part rendering.

so there is no need to have 2 seperate methods for formatting full session or streaming parts :)

You can see them here

cameronr/opencode.nvim@feat/incremental-rendering...sudo-tee:opencode.nvim:feat/incremental-rendering

@cameronr
Copy link
Collaborator

Oh nice! I had been waiting for the streaming rendering to be good enough to switch over but it seems like we're there.

Thanks for fixing the selection context issue! I didn't have any tests cases for that but I'll add a replay for that.

I also noticed the header separator change. No problem on that change but it does break the unit tests.

I'll add a script to regenerate all of the save replay data (only to be used when making this kind of format change) and I'll update the test data.

I'll also add a github workflow to run the tests on submit/pr.

@cameronr cameronr force-pushed the feat/incremental-rendering branch from dd6732f to 30f5233 Compare October 14, 2025 20:24
@cameronr
Copy link
Collaborator

cameronr commented Oct 14, 2025

@sudo-tee I'm going to start cleaning up session_formatter (unify the code between full session loading and streaming events more, clean up the M.output hacks used by streaming currently). My quick thinking is:

  1. session_formatter should be renamed formatter and it shouldn't store any state
  2. streaming_renderer should be renamed renderer
  3. output_renderer should be removed (at some point)
  4. the full session loading code should move to renderer
  5. renderer uses formatter to format the messages (as it does today, it's just helpful to me to have a clear idea of what each piece is doing)

@sudo-tee
Copy link
Owner Author

@sudo-tee I'm going to start cleaning up session_formatter (unify the code between full session loading and streaming events more, clean up the M.output hacks used by streaming currently). My quick thinking is:

  1. session_formatter should be renamed formatter and it shouldn't store any state
  2. streaming_renderer should be renamed renderer
  3. output_renderer should be removed (at some point)
  4. the full session loading code should move to renderer
  5. renderer uses formatter to format the messages (as it does today, it's just helpful to me to have a clear idea of what each piece is doing)

This seems pretty reasonable to me 😁

@sudo-tee
Copy link
Owner Author

@cameronr

I added a managed event file.edited to refresh files when edited.

I also took the liberty to create a dedicated class to do message data lookups. A big chunk of the rendered was just looking up for data. I created a MessageMap with tests class that will do the actual indexing and searching of parts/messages callId.

I also fixed some issues with The Message type, since the migration to server api the types were not correct. I renames Message to OpencodeMessage, because my lsp was mixing it with an internal type of libuv.

I realized (before the refactor) that the contextual actions were not working properly.

Thanks :)

@cameronr
Copy link
Collaborator

Nice! That's a really nice improvement; cleans things up quite a bit. And love the tests!

I think context actions, undo/redo/snapshots, and prev/next message are the big remaining things that need to be hooked back up. output.lua is related and that's the code I'm looking at now so hoping to make some progress on how it should all fit together.

It's getting there!

@cameronr
Copy link
Collaborator

cameronr commented Oct 16, 2025

@sudo-tee I'm thinking about changing how we process messages / parts from a full session. Right now, there's two different code paths: the full session code path and the event code path. They leverage a lot of the same functionality but they're still subtly different. As one small example, the session reading code wasn't setting state.last_user_message anywhere.

It won't be quite as efficient (we'll end up looking up some indexes more often) but i think that the single code path simplicity is worth the extra lookups. Fortunately, MessageMap makes any perf penalty there prolly irrelevant :)

It would involve removing formatter._format_messages and replacing it with a loop in renderer._read_full_session_data:

  for i, msg in ipairs(session_data) do
    if state.active_session.revert and state.active_session.revert.messageID == msg.info.id then
      ---@type {messages: number, tool_calls: number, files: table<string, {additions: number, deletions: number}>}
      local revert_stats = M._calculate_revert_stats(state.messages, i, state.active_session.revert)
      local output = require('opencode.ui.output'):new()
      formatter._format_revert_message(output, revert_stats)
      M.write_output(output)

      -- FIXME: how does reverting work? why is it breaking out of the message reading loop?
      break
    end

    -- only pass in the info so, the parts will be processed as part of the loop
    -- TODO: remove part processing code in formatter
    M.on_message_updated({ info = msg.info })

    for j, part in ipairs(msg.parts or {}) do
      M.on_part_updated({ part = part })
    end

    -- FIXME: not sure how this error rendering code works when streaming
    -- if msg.info.error and msg.info.error ~= '' then
    --   vim.notify('calling _format_error')
    --   M._format_error(output, msg.info)
    -- end
  end

That way, we're always adding things exactly the same way. It's still possible for streaming to have bugs because of deltas / part replacement but I think the way to have the code be the most robust is to minimize the code paths.

I think it'll also help with cleaning up the types (and maybe even reduce the amount of index shuttling we're having to do) since there will only be one code path.

Does that sound ok?

@sudo-tee
Copy link
Owner Author

@sudo-tee I'm thinking about changing how we process messages / parts from a full session. Right now, there's two different code paths: the full session code path and the event code path. The leverage a lot of the same functionality but they're still subtly different. It won't be quite as efficient (we'll end up looking up some indexes more often) but i think that the single code path simplicity is worth the (likely tiny perf penalty).

It would involve removing formatter._format_messages and replacing it with a loop in renderer._read_full_session_data:

  for i, msg in ipairs(session_data) do
    if state.active_session.revert and state.active_session.revert.messageID == msg.info.id then
      ---@type {messages: number, tool_calls: number, files: table<string, {additions: number, deletions: number}>}
      local revert_stats = M._calculate_revert_stats(state.messages, i, state.active_session.revert)
      local output = require('opencode.ui.output'):new()
      formatter._format_revert_message(output, revert_stats)
      M.write_output(output)

      -- FIXME: how does reverting work? why is it breaking out of the message reading loop?
      break
    end

    -- only pass in the info so, the parts will be processed as part of the loop
    -- TODO: remove part processing code in formatter
    M.on_message_updated({ info = msg.info })

    for j, part in ipairs(msg.parts or {}) do
      M.on_part_updated({ part = part })
    end

    -- FIXME: not sure how this error rendering code works when streaming
    -- if msg.info.error and msg.info.error ~= '' then
    --   vim.notify('calling _format_error')
    --   M._format_error(output, msg.info)
    -- end
  end

That way, we're always adding things exactly the same way. It's still possible for streaming to have bugs because of deltas / part replacement but I think the way to have the code be the most robust is to minimize the code paths.

Does that sound ok?

Yes that sounds reasonable to me. It's always good to have a common code path

I could explain a little more how revert works. But I only have access to my phone for the next couple of days.

But essentially opencode will store the message Id of where the revert happens. And the rest of the messages don't technically exists. So the stats are calculated from that revert point. If you call /revert another time it will move up to the previous messageId. and so one.

At the moment this is buggy in opencode as once the server is closed.. or the opencode tui is closed you cannot revert anymore it gives an error and Delete the files entirely 😵. There are a couple of open bugs on the open code repo about it.

Again I am very grateful for your help on complex topics. Keep up the good work.

@cameronr
Copy link
Collaborator

Ok, great, I'll keep moving in that direction.

And thanks for the explanation of revert. I'll see if I can figure out how to handle that for session load and when streaming events.

@cameronr
Copy link
Collaborator

cameronr commented Oct 17, 2025

I did a fairly big refactor and introduced a new RenderState object that subsumed _part_cache, _message_map, and _actions to better handle finding parts/messages and tracking their rendered position. I think I'm happy with how that code is coming along :)

Separately, I haven't had a chance to look at snapshots/undo/redo yet but I've noticed a few times where canceling a request didn't result in job_count == 0. I have some ideas on that so I'm going to take a look at that next.

@sudo-tee
Copy link
Owner Author

I did a fairly big refactor and introduced a new RenderState object that subsumed _part_cache, _message_map, and _actions to better handle finding parts/messages and tracking their rendered position. I think I'm happy with how that code is coming along :)

Separately, I haven't had a chance to look at snapshots/undo/redo yet but I've noticed a few times where canceling a request didn't result in job_count == 0. I have some ideas on that so I'm going to take a look at that next.

Awesome. I think the RenderState reflect the idea I had in my head with The Output class and the MessageMap. I think you found the pattern I was searching for. Great idea. For the undo redo I will be back home this weekend and will have a look if you want.

There is also a couple of bugs that are piling up in the repo that I need to address.

Thanks again

@cameronr
Copy link
Collaborator

I'll actually be away for much of this weekend so it would be amazing if you were able to look into undo / redo / snapshots!

I'm hoping the big changes are done and now it's mostly about hooking things back up and doing a bunch of testing to build confidence that it's all working.

@sudo-tee
Copy link
Owner Author

@cameronr

I'm almost there for the revert part. I only need to make it work with the test replay.

@cameronr
Copy link
Collaborator

that's great! let me know if you have any trouble with getting the replay testing working (or with the rendering).

one note is that each replay tests both incremental rendering (streamed events) and full session loads (to make sure they render the same as incremental). the full session loads are reconstructed from the events, tho, and that reconstruction doesn't handle some things (like permissions) so some tests need to disable full session testing.

@sudo-tee
Copy link
Owner Author

sudo-tee commented Oct 20, 2025

@cameronr

I pushed my fix for undo/redo.

I fixed redo to match the opencode tui behavior

I also added some tests for undo redo

I will have a look at snapshots next.

@sudo-tee
Copy link
Owner Author

sudo-tee commented Oct 20, 2025

@cameronr

Snapshots are a custom thing so there is no event for it... With the proper undo redo behavior. I am wondering if simply calling undo on the message instead of having 2 different workflow with slightly different meaning..

Although the snapshot handling is more granular than the undo redo..

@cameronr
Copy link
Collaborator

Nice! I think we're getting pretty close!

There's a FIXME in output_window about restore_points. Can you take a look at that whenever you next have a chance?

@cameronr cameronr force-pushed the feat/incremental-rendering branch 2 times, most recently from ab7f7d0 to de2657a Compare October 20, 2025 19:53
@cameronr
Copy link
Collaborator

I have a todo item for mentions but I'm not sure how they work so could use some help.

In the old code, output_renderer called highlight_all_mentions after rendering:

pcall(function()
render()
require('opencode.ui.mention').highlight_all_mentions(windows.output_buf)
require('opencode.ui.contextual_actions').setup_contextual_actions()
require('opencode.ui.footer').render(windows)
end)

My reading of the highlight_all_mentions code says it would apply the OpencodeMention extmark to anything in that output that was like @word (where word can include _-./. That doesn't seem right as many things might match that (lua comments like @param, as just one example).

One option might be to only apply the highlight to the text property of a part but I don't have any examples of what I think highlights is attempting to match. Do you have any examples (or have a good way to generate them)?

thanks!

@sudo-tee
Copy link
Owner Author

sudo-tee commented Oct 21, 2025

Nice! I think we're getting pretty close!

There's a FIXME in output_window about restore_points. Can you take a look at that whenever you next have a chance?

@cameronr

I was able to plug restore_points back. But unfortunately I cold not get it to work properly in the replay renderer as it reads the filesystem for data.

This is where I question if I should keep the feature or not. It's useful but it differs From the Opencode way of doing it.

@sudo-tee
Copy link
Owner Author

sudo-tee commented Oct 21, 2025

I have a todo item for mentions but I'm not sure how they work so could use some help.

In the old code, output_renderer called highlight_all_mentions after rendering:

pcall(function()
render()
require('opencode.ui.mention').highlight_all_mentions(windows.output_buf)
require('opencode.ui.contextual_actions').setup_contextual_actions()
require('opencode.ui.footer').render(windows)
end)

My reading of the highlight_all_mentions code says it would apply the OpencodeMention extmark to anything in that output that was like @word (where word can include _-./. That doesn't seem right as many things might match that (lua comments like @param, as just one example).

One option might be to only apply the highlight to the text property of a part but I don't have any examples of what I think highlights is attempting to match. Do you have any examples (or have a good way to generate them)?

thanks!

@cameronr

The highlight_all_mentions is indeed finding @{subagent} or the @path/to/file.lua and add highlight to them.

When you type @ in the input_window and select either a file or a subagent , it will call highlight_all_mentions also on the input_window to highlight them.

You are right that in the output_window it might be error prone.

However if you look at the message you at the messages generated you will see them with a range

{
      "messageID": "msg_a06c4164a0015W5xZmeTCOAuhE",
      "source": {
        "text": {
          "value": "@test.txt",
          "end": 8,
          "start": 0
        },
        "path": "/home/francis/Projects/_nvim/opencode.nvim/test.txt",
        "type": "file"
      },
      "mime": "text/plain",
      "type": "file",
      "id": "prt_a06c416520063e9hNFYlVzbCvm",
      "url": "file:///home/francis/Projects/_nvim/opencode.nvim/test.txt",
      "filename": "test.txt",
      "sessionID": "ses_5f9558f7affeMXh93WS3cQpzjB"
    },
    {
      "messageID": "msg_a06c60f89001za14H2cqggp6uq",
      "type": "agent",
      "id": "prt_a06c60f89003AyAUE4WJWAXoHK",
      "source": {
        "value": "@foo",
        "end": 4,
        "start": 0
      },
      "name": "foo",
      "sessionID": "ses_5f9558f7affeMXh93WS3cQpzjB"
    },

The source part indicates the range in the text (this is how they do in internally in opencode)

Maybe we can use theses to generate the proper highlight ? or maybe use the value part for the match something.

UPDATE:

It's more complicated than it looks as the user prompt is rendered before the other message parts.

@cameronr
Copy link
Collaborator

I have a little bit of debug logging to remove. After that, we should just give a few days of bake time to make sure I didn't break anything / no other issues pop up. Will be great to get it out!

I'm soooo glad we had the unit tests and replay system. It wouldn't have been possible to improve things so quickly without them!

@sudo-tee
Copy link
Owner Author

sudo-tee commented Oct 25, 2025

On a different note.

I am thinking of changing the plugin name and maybe soon having release numbers. GitHub supports renaming project so it should be fine

There is already another plugin named opencode.nvim.

I have a couple of names and wanted your input.

  • openkode.nvim
  • nvim-opencode
  • neocoder.nvim
  • opencoder.nvim
  • opencode-ui.nvim
  • codepal.nvim
  • libre-code.nvim

I'm open for ideas ⁉️

@cameronr
Copy link
Collaborator

Oh funny, I didn't even know about the other one. Native neovim UI and keymaps/navigation is such an improvement over a terminal integration, at least in my opinion... but I'm biased :)

On names, here are some that stand out to me:

  • opencode.nvim (leave it as is and let the community sort it out)
  • opencode-native.nvim (highlight the native aspect of it)
  • neopencode.nvim (it's a little cumbersome but i think maintaining the connection to opencode is important)
  • neo-opencode (another take on the idea above).

I do think keeping a direct connection to opencode is important from a "branding" perspective.

I've seen RenderMarkdown leave some extmarks behind so force clear
extmarks in all domains when clearing the output window.
@cameronr
Copy link
Collaborator

@sudo-tee It's purely cosmetic, but what do you think about switching the default thinking animation to:

Kapture 2025-10-26 at 08 23 53

The one above is smoother/less jumpy/distracting than the current default. If not, no worries.

Restoring position was moving the cursor to the start of the input box
(the initial last saved position before we started insert mode) when
adding a mention rather than leaving the cursor where it is (i.e. where
the user is typing)

Since we're almost certainly already in insert mode, we don't want to
restore position when adding a mention / slash_command.
Snacks doesn't seem to restore the window/mode/cursor position when you
close the picker. We're already handling the case when you pick a file
but we weren't handling the case when you close the picker without
picking a file.

Now we save the window, mode, and cursor position and restore those if
we didn't pick a file
@sudo-tee
Copy link
Owner Author

@sudo-tee It's purely cosmetic, but what do you think about switching the default thinking animation to:

Kapture 2025-10-26 at 08 23 53

The one above is smoother/less jumpy/distracting than the current default. If not, no worries.

Yes I'm ok with it. The current one can be distracting at time.

@cameronr
Copy link
Collaborator

I've just been cleaning up some diagnostics. I did change the emmyrc to not include $HOME/.local/share/nvim/lazy as that can introduce some type conflicts if plugins define the same types (that was happening to me). I think it's probably the better choice but let me know if you think otherwise.

I ran into an issue where I'd messed up my opencode config and I was
getting unhelpful "Error executing vim.schedule lua callback: [NULL]"
errors.

The combo of promises and pcalls is kind of gross but it's better to
report the errors than swallow them and surface unhelpful, generic
errors.
I've still seen occasional issues where job_count is either too high or
too low. I think this is the most correct way to set it.

Also, have to wrap notifys since we're in a fast context at that point.
Cancel a pending permission if we're aborting
Also clear pending permission on server restart
@cameronr
Copy link
Collaborator

I did a bunch of testing and things look pretty good. I did find a few issues, summarized:

  • clear all extmarks in output_window (needed because RenderMarkdown sometimes leaves extmarks behind) 6f424e0
  • @ mentions were resetting the cursor position if you'd previously left the input window 4f1d172
  • snacks file picker wasn't restoring the window, mode, cursor position c1b9568
  • report promise errors. this will surface problems like opencode config errors e5cb4a1
  • hopefully a permanent fix to spinner spinning at wrong times 097874c
  • more resilient aborting, including handling permissions 4b7187d

@sudo-tee
Copy link
Owner Author

sudo-tee commented Oct 27, 2025

This is really nice. A bunch of little fixes.

We are almost ready to merge.

Maybe one last thing. I usually run with debug mode on. Can we have a setting for the events notifications under debug ? So I can run without them ?

After this I will probably merge as it looks stable to me also

EDIT:
My bad I was checking the wrong version

So if you feel it's safe to merge I will proceed.

@sudo-tee sudo-tee merged commit bebe01c into sudo-tee:main Oct 27, 2025
5 checks passed
@sudo-tee
Copy link
Owner Author

@cameronr

I just merged your amazing work. 🎉

Github didn't let me do a simple merge, only a squash would work. I did add you as a co-author because I din't want you to loose credit for all your work :).

Thank you again for your work 🔥

@cameronr
Copy link
Collaborator

Oh great! I was just about to comment and say it looks good. Glad it's finally out!

DanRioDev pushed a commit to DanRioDev/opencode.nvim that referenced this pull request Oct 28, 2025
commit 3f13fe8a10c6f02e7cbcbbaf0b3c0eff403f9c4d
Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
Date:   Tue Oct 28 12:14:28 2025 -0300

    Squashed commit of the following:

    commit 3dea370
    Author: Francis Belanger <francis.belanger@gmail.com>
    Date:   Tue Oct 28 08:49:27 2025 -0400

        chore(emmyrc): fix broken .emmyrc.json

    commit c07f293
    Author: Cameron Ring <cameron@cs.stanford.edu>
    Date:   Mon Oct 27 17:32:50 2025 -0700

        fix(renderer): render errors after last part

    commit bebe01c
    Author: Francis Belanger <francis.belanger@gmail.com>
    Date:   Mon Oct 27 15:56:57 2025 -0400

        feat(rendering): incremental rendering (sudo-tee#62)

        Introduces an incremental rendering that updates only the changed portion(s) of the buffer instead of re-rendering everything on every change. This reduces CPU usages for large sessions.

        This PR also incorporate a functional test suite in `tests/manual` where you can record a run snapshot tests.

        This is a major revision of the rendering system.

        Co-authored-by:  Cameron Ring <cameron@cs.stanford.edu>

commit a3e12fcf781471b2f2880118e94091183bd4cd85
Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
Date:   Tue Oct 28 10:57:59 2025 -0300

    feat(ui/context): enhance loading animation and context management

commit a8382b83f1a76ec1e1e9a362f5eaa67071b53c70
Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
Date:   Fri Oct 24 17:29:43 2025 -0300

    Squashed commit of the following:

    commit 25c099d
    Merge: 7874524 23f384e
    Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
    Date:   Tue Oct 7 16:10:20 2025 -0300

        Merge remote-tracking branch 'origin/main'

    commit 7874524
    Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
    Date:   Fri Oct 3 11:43:15 2025 -0300

        fix(git): missing files in context module

    commit 7d90008
    Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
    Date:   Fri Oct 3 10:44:45 2025 -0300

        feat(contex): better privacy and contextual awareness

    commit 9c65ef8
    Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
    Date:   Thu Oct 2 19:56:19 2025 -0300

        fix(hanging_close): clear all windows was hangin neovim

    commit ce8d473
    Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
    Date:   Tue Oct 7 16:03:37 2025 -0300

        fix(performace): proper detector and cleaner

    commit 3ab8e87
    Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
    Date:   Thu Oct 2 17:39:42 2025 -0300

        fix(autocmd): best to fetch context when user is idle

    commit d76b16c
    Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
    Date:   Thu Oct 2 20:42:41 2025 -0300

        fix(type): rollback for better reading

    commit 850bdca
    Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
    Date:   Tue Oct 7 15:37:28 2025 -0300

        refactor: clean up PR sudo-tee#42 based on maintainer feedback

        - Remove unnecessary inline type annotations in session_formatter.lua
        - Remove deprecated assistant_mode field from Message type
        - Simplify mode field documentation
        - Remove assistant_mode fallback logic in header formatting
        - Restore accidentally deleted keymap and context config fields
        - Fix indentation inconsistencies

        This addresses all review feedback from @sudo-tee while preserving
        the core feature: using CLI-persisted mode field to display agent
        names (BUILD, PLAN, etc.) in assistant message headers.

    commit 1573b3d
    Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
    Date:   Thu Oct 2 16:43:04 2025 -0300

        fix(ui): use CLI-persisted mode field instead of client-side assistant_mode mutation

        - Read message.mode field from CLI-persisted JSON (already stored by opencode)
        - Remove client-side assistant_mode mutation in core.lua (lines 145-154)
        - Add message.mode to Message type definition, mark assistant_mode as deprecated
        - Update session_formatter to prefer message.mode over message.assistant_mode
        - Maintain backward compatibility with fallback chain: mode → assistant_mode → current_mode → ASSISTANT
        - Eliminates need for client-side mode persistence since CLI handles it

    commit 35eedbe
    Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
    Date:   Thu Oct 2 16:27:55 2025 -0300

        fix: show current mode for latest assistant message when assistant_mode is missing

        Display-time fallback for the most recent assistant message to show the current mode name when assistant_mode field hasn't been stamped yet. This fixes new messages showing generic 'ASSISTANT' instead of the active mode label (e.g., 'NEOAGENT').

        Historical messages remain unchanged, preserving their original mode labels or showing generic 'ASSISTANT' for old messages created before mode tracking was added.

    commit 9229b87
    Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
    Date:   Tue Oct 7 14:30:56 2025 -0300

        fix(ui): use CLI-persisted mode field instead of client-side assistant_mode mutation

        - Read message.mode field from CLI-persisted JSON (already stored by opencode)
        - Remove client-side assistant_mode mutation in core.lua (lines 145-154)
        - Add message.mode to Message type definition, mark assistant_mode as deprecated
        - Update session_formatter to prefer message.mode over message.assistant_mode
        - Maintain backward compatibility with fallback chain: mode → assistant_mode → current_mode → ASSISTANT
        - Eliminates need for client-side mode persistence since CLI handles it

    commit b99d997
    Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
    Date:   Thu Oct 2 16:17:38 2025 -0300

        fix(ui): remove assistant_mode backfill to preserve historical mode labels

        The backfill loop was seeding from state.current_mode and stamping all
        historical assistant messages without assistant_mode, causing every
        message to show the current mode's name on restart rather than the mode
        used at that point in time.

        Removed lines 35-46 (backfill loop). Historical messages without
        assistant_mode now display as generic 'ASSISTANT' via existing fallback
        logic in _format_message_header (lines 299-304).

        This preserves immutability of stored assistant_mode values and prevents
        cross-session pollution.

    commit 008d290
    Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
    Date:   Thu Oct 2 15:39:47 2025 -0300

        feat(context): add recent_buffers synthetic context (MRU buffers with optional symbols)

    commit 2231aeb
    Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
    Date:   Thu Oct 2 15:35:51 2025 -0300

        feat(ui): stabilize assistant_mode labeling and improve session formatting robustness\n\n- Persist assistant_mode onto latest assistant message after run\n- Backfill assistant_mode for historical assistant messages for stable display names\n- Use assistant_mode (uppercase) in headers instead of generic ASSISTANT\n- Improve revert stats typing and snapshot action anchoring with display_line + range\n- Harden get_message_at_line nil checks to avoid indexing errors\n- Extend MessagePart.type to include patch and step-start; allow OutputExtmark function form\n- Add assistant_mode field to Message type\n- Fix synthetic user message check (part.synthetic ~= true)\n- Improve callout width handling when window invalid; fallback to config width or 80\n- Add type annotations for tool formatting inputs/metadata/output\n- Correct diff virt_text structure and highlight group names\n- General annotation cleanup and stability improvements

    commit 6f35278
    Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
    Date:   Thu Oct 2 13:27:13 2025 -0300

        fix: add caching to context.load(), debounce WinLeave autocmd, fix types for LSP

    commit 3047974
    Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
    Date:   Thu Oct 2 12:50:11 2025 -0300

        feat: enhance context with plugin versions and buffer symbols, update types and tests

    commit d7f1ead
    Author: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
    Date:   Thu Oct 2 13:17:10 2025 +0000

        Update README with enhanced context documentation

        Co-authored-by: DanRioDev <1839750+DanRioDev@users.noreply.github.com>

    commit 32819c0
    Author: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
    Date:   Thu Oct 2 13:14:30 2025 +0000

        Add enhanced context gathering functions and tests

        Co-authored-by: DanRioDev <1839750+DanRioDev@users.noreply.github.com>

    commit f9f4f16
    Author: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
    Date:   Thu Oct 2 13:06:57 2025 +0000

        Initial plan

    commit 23f384e
    Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
    Date:   Fri Oct 3 11:43:15 2025 -0300

        fix(git): missing files in context module

    commit df83776
    Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
    Date:   Fri Oct 3 10:44:45 2025 -0300

        feat(contex): better privacy and contextual awareness

    commit f30c47a
    Merge: 34edf5d 0d102c0
    Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
    Date:   Thu Oct 2 20:57:12 2025 -0300

        Merge branch 'enhanced-context'

    commit 34edf5d
    Merge: 3e7a8a8 55cc0db
    Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
    Date:   Thu Oct 2 20:53:32 2025 -0300

        Merge branch 'style-assistant-name-is-agent-name'

    commit 55cc0db
    Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
    Date:   Thu Oct 2 20:42:41 2025 -0300

        fix(type): rollback for better reading

    commit f26b069
    Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
    Date:   Thu Oct 2 20:28:51 2025 -0300

        refactor: clean up PR sudo-tee#42 based on maintainer feedback

        - Remove unnecessary inline type annotations in session_formatter.lua
        - Remove deprecated assistant_mode field from Message type
        - Simplify mode field documentation
        - Remove assistant_mode fallback logic in header formatting
        - Restore accidentally deleted keymap and context config fields
        - Fix indentation inconsistencies

        This addresses all review feedback from @sudo-tee while preserving
        the core feature: using CLI-persisted mode field to display agent
        names (BUILD, PLAN, etc.) in assistant message headers.

    commit 0d102c0
    Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
    Date:   Thu Oct 2 19:56:19 2025 -0300

        fix(hanging_close): clear all windows was hangin neovim

    commit 1f8da59
    Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
    Date:   Thu Oct 2 18:45:10 2025 -0300

        fix(performace): proper detector and cleaner

    commit 8fd42b9
    Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
    Date:   Thu Oct 2 17:39:42 2025 -0300

        fix(autocmd): best to fetch context when user is idle

    commit c3f6e17
    Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
    Date:   Thu Oct 2 17:35:21 2025 -0300

        fix(clean_up): remove unwanted specify file

    commit 1ef95f5
    Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
    Date:   Thu Oct 2 16:43:04 2025 -0300

        fix(ui): use CLI-persisted mode field instead of client-side assistant_mode mutation

        - Read message.mode field from CLI-persisted JSON (already stored by opencode)
        - Remove client-side assistant_mode mutation in core.lua (lines 145-154)
        - Add message.mode to Message type definition, mark assistant_mode as deprecated
        - Update session_formatter to prefer message.mode over message.assistant_mode
        - Maintain backward compatibility with fallback chain: mode → assistant_mode → current_mode → ASSISTANT
        - Eliminates need for client-side mode persistence since CLI handles it

    commit c08f7e3
    Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
    Date:   Thu Oct 2 16:27:55 2025 -0300

        fix: show current mode for latest assistant message when assistant_mode is missing

        Display-time fallback for the most recent assistant message to show the current mode name when assistant_mode field hasn't been stamped yet. This fixes new messages showing generic 'ASSISTANT' instead of the active mode label (e.g., 'NEOAGENT').

        Historical messages remain unchanged, preserving their original mode labels or showing generic 'ASSISTANT' for old messages created before mode tracking was added.

    commit 80279eb
    Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
    Date:   Thu Oct 2 16:17:38 2025 -0300

        fix(ui): remove assistant_mode backfill to preserve historical mode labels

        The backfill loop was seeding from state.current_mode and stamping all
        historical assistant messages without assistant_mode, causing every
        message to show the current mode's name on restart rather than the mode
        used at that point in time.

        Removed lines 35-46 (backfill loop). Historical messages without
        assistant_mode now display as generic 'ASSISTANT' via existing fallback
        logic in _format_message_header (lines 299-304).

        This preserves immutability of stored assistant_mode values and prevents
        cross-session pollution.

    commit 3e7a8a8
    Merge: 2b691a6 be7c6a6
    Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
    Date:   Thu Oct 2 17:06:17 2025 -0300

        Merge branch 'style-assistant-name-is-agent-name'

    commit be7c6a6
    Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
    Date:   Thu Oct 2 16:43:04 2025 -0300

        fix(ui): use CLI-persisted mode field instead of client-side assistant_mode mutation

        - Read message.mode field from CLI-persisted JSON (already stored by opencode)
        - Remove client-side assistant_mode mutation in core.lua (lines 145-154)
        - Add message.mode to Message type definition, mark assistant_mode as deprecated
        - Update session_formatter to prefer message.mode over message.assistant_mode
        - Maintain backward compatibility with fallback chain: mode → assistant_mode → current_mode → ASSISTANT
        - Eliminates need for client-side mode persistence since CLI handles it

    commit 82cf73e
    Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
    Date:   Thu Oct 2 16:27:55 2025 -0300

        fix: show current mode for latest assistant message when assistant_mode is missing

        Display-time fallback for the most recent assistant message to show the current mode name when assistant_mode field hasn't been stamped yet. This fixes new messages showing generic 'ASSISTANT' instead of the active mode label (e.g., 'NEOAGENT').

        Historical messages remain unchanged, preserving their original mode labels or showing generic 'ASSISTANT' for old messages created before mode tracking was added.

    commit db5ab7b
    Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
    Date:   Thu Oct 2 16:17:38 2025 -0300

        fix(ui): remove assistant_mode backfill to preserve historical mode labels

        The backfill loop was seeding from state.current_mode and stamping all
        historical assistant messages without assistant_mode, causing every
        message to show the current mode's name on restart rather than the mode
        used at that point in time.

        Removed lines 35-46 (backfill loop). Historical messages without
        assistant_mode now display as generic 'ASSISTANT' via existing fallback
        logic in _format_message_header (lines 299-304).

        This preserves immutability of stored assistant_mode values and prevents
        cross-session pollution.

    commit 9a59aaf
    Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
    Date:   Thu Oct 2 15:39:47 2025 -0300

        feat(context): add recent_buffers synthetic context (MRU buffers with optional symbols)

    commit cf1c5fd
    Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
    Date:   Thu Oct 2 15:35:51 2025 -0300

        feat(ui): stabilize assistant_mode labeling and improve session formatting robustness\n\n- Persist assistant_mode onto latest assistant message after run\n- Backfill assistant_mode for historical assistant messages for stable display names\n- Use assistant_mode (uppercase) in headers instead of generic ASSISTANT\n- Improve revert stats typing and snapshot action anchoring with display_line + range\n- Harden get_message_at_line nil checks to avoid indexing errors\n- Extend MessagePart.type to include patch and step-start; allow OutputExtmark function form\n- Add assistant_mode field to Message type\n- Fix synthetic user message check (part.synthetic ~= true)\n- Improve callout width handling when window invalid; fallback to config width or 80\n- Add type annotations for tool formatting inputs/metadata/output\n- Correct diff virt_text structure and highlight group names\n- General annotation cleanup and stability improvements

    commit 2b691a6
    Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
    Date:   Thu Oct 2 13:27:13 2025 -0300

        fix: add caching to context.load(), debounce WinLeave autocmd, fix types for LSP

    commit 9e8ebb5
    Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
    Date:   Thu Oct 2 12:50:11 2025 -0300

        feat: enhance context with plugin versions and buffer symbols, update types and tests

    commit 29cfaf2
    Author: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
    Date:   Thu Oct 2 13:17:10 2025 +0000

        Update README with enhanced context documentation

        Co-authored-by: DanRioDev <1839750+DanRioDev@users.noreply.github.com>

    commit 0e01ac7
    Author: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
    Date:   Thu Oct 2 13:14:30 2025 +0000

        Add enhanced context gathering functions and tests

        Co-authored-by: DanRioDev <1839750+DanRioDev@users.noreply.github.com>

    commit 8d28ff2
    Author: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
    Date:   Thu Oct 2 13:06:57 2025 +0000

        Initial plan

commit 75504e9
Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
Date:   Thu Oct 9 19:10:31 2025 -0300

    fix(base_url): race condition

commit e0506af
Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
Date:   Thu Oct 2 16:27:55 2025 -0300

    fix: show current mode for latest assistant message when assistant_mode is missing

    Display-time fallback for the most recent assistant message to show the current mode name when assistant_mode field hasn't been stamped yet. This fixes new messages showing generic 'ASSISTANT' instead of the active mode label (e.g., 'NEOAGENT').

    Historical messages remain unchanged, preserving their original mode labels or showing generic 'ASSISTANT' for old messages created before mode tracking was added.

commit 5cc8c74
Author: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Date:   Thu Oct 2 13:06:57 2025 +0000

    Initial plan

commit 52c66e5
Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
Date:   Thu Oct 2 17:39:42 2025 -0300

    fix(autocmd): best to fetch context when user is idle

commit 3c04ded
Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
Date:   Thu Oct 2 20:42:41 2025 -0300

    fix(type): rollback for better reading

commit 93d880a
Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
Date:   Tue Oct 7 15:37:28 2025 -0300

    refactor: clean up PR sudo-tee#42 based on maintainer feedback

    - Remove unnecessary inline type annotations in session_formatter.lua
    - Remove deprecated assistant_mode field from Message type
    - Simplify mode field documentation
    - Remove assistant_mode fallback logic in header formatting
    - Restore accidentally deleted keymap and context config fields
    - Fix indentation inconsistencies

    This addresses all review feedback from @sudo-tee while preserving
    the core feature: using CLI-persisted mode field to display agent
    names (BUILD, PLAN, etc.) in assistant message headers.

commit f8c504f
Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
Date:   Thu Oct 2 16:43:04 2025 -0300

    fix(ui): use CLI-persisted mode field instead of client-side assistant_mode mutation

    - Read message.mode field from CLI-persisted JSON (already stored by opencode)
    - Remove client-side assistant_mode mutation in core.lua (lines 145-154)
    - Add message.mode to Message type definition, mark assistant_mode as deprecated
    - Update session_formatter to prefer message.mode over message.assistant_mode
    - Maintain backward compatibility with fallback chain: mode → assistant_mode → current_mode → ASSISTANT
    - Eliminates need for client-side mode persistence since CLI handles it

commit 142f0ed
Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
Date:   Thu Oct 2 16:27:55 2025 -0300

    fix: show current mode for latest assistant message when assistant_mode is missing

    Display-time fallback for the most recent assistant message to show the current mode name when assistant_mode field hasn't been stamped yet. This fixes new messages showing generic 'ASSISTANT' instead of the active mode label (e.g., 'NEOAGENT').

    Historical messages remain unchanged, preserving their original mode labels or showing generic 'ASSISTANT' for old messages created before mode tracking was added.

commit 8251287
Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
Date:   Tue Oct 7 14:30:56 2025 -0300

    fix(ui): use CLI-persisted mode field instead of client-side assistant_mode mutation

    - Read message.mode field from CLI-persisted JSON (already stored by opencode)
    - Remove client-side assistant_mode mutation in core.lua (lines 145-154)
    - Add message.mode to Message type definition, mark assistant_mode as deprecated
    - Update session_formatter to prefer message.mode over message.assistant_mode
    - Maintain backward compatibility with fallback chain: mode → assistant_mode → current_mode → ASSISTANT
    - Eliminates need for client-side mode persistence since CLI handles it

commit fbb30fc
Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
Date:   Thu Oct 2 16:17:38 2025 -0300

    fix(ui): remove assistant_mode backfill to preserve historical mode labels

    The backfill loop was seeding from state.current_mode and stamping all
    historical assistant messages without assistant_mode, causing every
    message to show the current mode's name on restart rather than the mode
    used at that point in time.

    Removed lines 35-46 (backfill loop). Historical messages without
    assistant_mode now display as generic 'ASSISTANT' via existing fallback
    logic in _format_message_header (lines 299-304).

    This preserves immutability of stored assistant_mode values and prevents
    cross-session pollution.

commit 8968117
Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
Date:   Thu Oct 2 15:39:47 2025 -0300

    feat(context): add recent_buffers synthetic context (MRU buffers with optional symbols)

commit e6e8948
Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
Date:   Thu Oct 2 15:35:51 2025 -0300

    feat(ui): stabilize assistant_mode labeling and improve session formatting robustness\n\n- Persist assistant_mode onto latest assistant message after run\n- Backfill assistant_mode for historical assistant messages for stable display names\n- Use assistant_mode (uppercase) in headers instead of generic ASSISTANT\n- Improve revert stats typing and snapshot action anchoring with display_line + range\n- Harden get_message_at_line nil checks to avoid indexing errors\n- Extend MessagePart.type to include patch and step-start; allow OutputExtmark function form\n- Add assistant_mode field to Message type\n- Fix synthetic user message check (part.synthetic ~= true)\n- Improve callout width handling when window invalid; fallback to config width or 80\n- Add type annotations for tool formatting inputs/metadata/output\n- Correct diff virt_text structure and highlight group names\n- General annotation cleanup and stability improvements

commit 2d2cb6a
Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
Date:   Thu Oct 2 13:27:13 2025 -0300

    fix: add caching to context.load(), debounce WinLeave autocmd, fix types for LSP

commit 888214d
Author: Danilo Verde Ribeiro <danrio@Danilos-MacBook-Pro.local>
Date:   Thu Oct 2 12:50:11 2025 -0300

    feat: enhance context with plugin versions and buffer symbols, update types and tests

commit 0c71b6c
Author: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Date:   Thu Oct 2 13:17:10 2025 +0000

    Update README with enhanced context documentation

    Co-authored-by: DanRioDev <1839750+DanRioDev@users.noreply.github.com>

commit bcbe451
Author: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Date:   Thu Oct 2 13:14:30 2025 +0000

    Add enhanced context gathering functions and tests

    Co-authored-by: DanRioDev <1839750+DanRioDev@users.noreply.github.com>

commit 04403d9
Author: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Date:   Thu Oct 2 13:06:57 2025 +0000

    Initial plan

commit 0f2d1e5
Author: Francis Belanger <francis.belanger@gmail.com>
Date:   Thu Oct 23 07:32:58 2025 -0400

    feat(blink): enable other completion sources for blink

    This should fix sudo-tee#65

commit e06f651
Author: Francis Belanger <francis.belanger@gmail.com>
Date:   Thu Oct 23 07:31:11 2025 -0400

    fix(cmp): fix file mention closing when typing for nvim_cmp

commit 84d9ae0
Author: Francis Belanger <francis.belanger@gmail.com>
Date:   Thu Oct 23 06:32:17 2025 -0400

    fix(mentions): letter `a` appended when triggering mentions

commit 44d22ba
Author: Francis Belanger <francis.belanger@gmail.com>
Date:   Thu Oct 23 06:23:49 2025 -0400

    test(toggle): fix tests for api.open

commit 826341d
Author: Francis Belanger <francis.belanger@gmail.com>
Date:   Thu Oct 23 06:18:09 2025 -0400

    fix(toggle): toggle keymap was always triggering insert mode

    This should fix sudo-tee#77

commit 803eb3e
Author: Francis Belanger <francis.belanger@gmail.com>
Date:   Wed Oct 22 15:53:52 2025 -0400

    docs(session_picker): add config for delete session in README

commit edba833
Author: Francis Belanger <francis.belanger@gmail.com>
Date:   Wed Oct 22 15:50:21 2025 -0400

    feat(session_picker): add keybind in title

commit 357ef3c
Author: Cameron Ring <cameron@cs.stanford.edu>
Date:   Fri Oct 17 18:37:41 2025 -0700

    feat(session_picker): Fixes sudo-tee#68

commit fed6941
Author: Francis Belanger <francis.belanger@gmail.com>
Date:   Mon Oct 20 15:19:21 2025 -0400

    fix(completion): completion were broken after last change

commit c505554
Author: Francis Belanger <francis.belanger@gmail.com>
Date:   Mon Oct 20 14:53:50 2025 -0400

    fix(focus_input): fix focusing input on window opening

commit 4824151
Author: Francis Belanger <francis.belanger@gmail.com>
Date:   Mon Oct 20 14:37:36 2025 -0400

    fix(input_window): properly restore input text when reopening the window

commit ca62c0c
Author: Francis Belanger <francis.belanger@gmail.com>
Date:   Mon Oct 20 14:24:17 2025 -0400

    fix(bash-tool): properly shown bash command on permission prompt

    This should fix sudo-tee#74

commit 28d6379
Author: Francis Belanger <francis.belanger@gmail.com>
Date:   Mon Oct 20 14:08:45 2025 -0400

    fix: focusing input window in insert mode

    The shortcut <C-i> is interpreted as <tab> by terminals I moved it to i. sudo-tee#72

    focusing the input_window should restore to the previous position not
    the char before sudo-tee#64

commit 946af3a
Author: Francis Belanger <francis.belanger@gmail.com>
Date:   Sat Oct 18 15:11:17 2025 -0400

    fix(slash_commands): allow slash_commands to be entered in input window

    This should fix sudo-tee#71

commit abc1e2a
Author: Francis Belanger <francis.belanger@gmail.com>
Date:   Sat Oct 18 11:25:55 2025 -0400

    feat(completion): add folder icon kind

commit 031bf0a
Author: Francis Belanger <francis.belanger@gmail.com>
Date:   Sat Oct 18 11:12:19 2025 -0400

    feat: support for folder mentions

commit e99a463
Author: Francis Belanger <francis.belanger@gmail.com>
Date:   Thu Oct 16 16:34:41 2025 -0400

    feat(completion): add file search from server api

commit 601cc82
Author: Cameron Ring <cameron@cs.stanford.edu>
Date:   Thu Oct 9 15:52:47 2025 -0700

    fix(config): add config metatable (sudo-tee#59)

    Fixes sudo-tee#58

    Makes config access less error prone and more ergonomic
DanRioDev pushed a commit to DanRioDev/opencode.nvim that referenced this pull request Oct 29, 2025
commit 7653234
Author: Guillaume BOEHM <github@mail.gboehm.com>
Date:   Wed Oct 29 10:27:47 2025 +0000

    feat: add prompt_guard callback mechanism (sudo-tee#78)

    This PR adds a plugin option to run a callback before sending promts to the LLM or before opening the opencode window.

    In my use case I want to be able to exclude some directories of my computer with sensitive information in order to not mistakenly send them to the LLM.
    I've mostly vibe-coded this and then went back on the code to check what it did, I'm not super well versed in lua so I might have missed things.

    Implementation details:

    Add prompt_guard configuration option (function that returns boolean)
    Check guard before sending prompts (ERROR notification if denied)
    Check guard before opening buffer first time (WARN notification if denied)
    Add util.check_prompt_allowed() helper functions
    Guard has no parameters, users can access vim state directly
    Proper error handling for guard callback failures

    Co-authored-by: Guillaume BOEHM <git@mail.gboehm.com>

commit 0dc254b
Author: Francis Belanger <francis.belanger@gmail.com>
Date:   Tue Oct 28 12:01:42 2025 -0400

    fix(run): context args not passed in run new session

commit 6eb7354
Author: Francis Belanger <francis.belanger@gmail.com>
Date:   Tue Oct 28 11:18:48 2025 -0400

    chore(icons): deprecate emoji icons in favor of nerdfonts

commit 3dea370
Author: Francis Belanger <francis.belanger@gmail.com>
Date:   Tue Oct 28 08:49:27 2025 -0400

    chore(emmyrc): fix broken .emmyrc.json

commit c07f293
Author: Cameron Ring <cameron@cs.stanford.edu>
Date:   Mon Oct 27 17:32:50 2025 -0700

    fix(renderer): render errors after last part

commit bebe01c
Author: Francis Belanger <francis.belanger@gmail.com>
Date:   Mon Oct 27 15:56:57 2025 -0400

    feat(rendering): incremental rendering (sudo-tee#62)

    Introduces an incremental rendering that updates only the changed portion(s) of the buffer instead of re-rendering everything on every change. This reduces CPU usages for large sessions.

    This PR also incorporate a functional test suite in `tests/manual` where you can record a run snapshot tests.

    This is a major revision of the rendering system.

    Co-authored-by:  Cameron Ring <cameron@cs.stanford.edu>

commit 0f2d1e5
Author: Francis Belanger <francis.belanger@gmail.com>
Date:   Thu Oct 23 07:32:58 2025 -0400

    feat(blink): enable other completion sources for blink

    This should fix sudo-tee#65

commit e06f651
Author: Francis Belanger <francis.belanger@gmail.com>
Date:   Thu Oct 23 07:31:11 2025 -0400

    fix(cmp): fix file mention closing when typing for nvim_cmp

commit 84d9ae0
Author: Francis Belanger <francis.belanger@gmail.com>
Date:   Thu Oct 23 06:32:17 2025 -0400

    fix(mentions): letter `a` appended when triggering mentions

commit 44d22ba
Author: Francis Belanger <francis.belanger@gmail.com>
Date:   Thu Oct 23 06:23:49 2025 -0400

    test(toggle): fix tests for api.open

commit 826341d
Author: Francis Belanger <francis.belanger@gmail.com>
Date:   Thu Oct 23 06:18:09 2025 -0400

    fix(toggle): toggle keymap was always triggering insert mode

    This should fix sudo-tee#77

commit 803eb3e
Author: Francis Belanger <francis.belanger@gmail.com>
Date:   Wed Oct 22 15:53:52 2025 -0400

    docs(session_picker): add config for delete session in README

commit edba833
Author: Francis Belanger <francis.belanger@gmail.com>
Date:   Wed Oct 22 15:50:21 2025 -0400

    feat(session_picker): add keybind in title

commit 357ef3c
Author: Cameron Ring <cameron@cs.stanford.edu>
Date:   Fri Oct 17 18:37:41 2025 -0700

    feat(session_picker): Fixes sudo-tee#68

commit fed6941
Author: Francis Belanger <francis.belanger@gmail.com>
Date:   Mon Oct 20 15:19:21 2025 -0400

    fix(completion): completion were broken after last change

commit c505554
Author: Francis Belanger <francis.belanger@gmail.com>
Date:   Mon Oct 20 14:53:50 2025 -0400

    fix(focus_input): fix focusing input on window opening

commit 4824151
Author: Francis Belanger <francis.belanger@gmail.com>
Date:   Mon Oct 20 14:37:36 2025 -0400

    fix(input_window): properly restore input text when reopening the window

commit ca62c0c
Author: Francis Belanger <francis.belanger@gmail.com>
Date:   Mon Oct 20 14:24:17 2025 -0400

    fix(bash-tool): properly shown bash command on permission prompt

    This should fix sudo-tee#74

commit 28d6379
Author: Francis Belanger <francis.belanger@gmail.com>
Date:   Mon Oct 20 14:08:45 2025 -0400

    fix: focusing input window in insert mode

    The shortcut <C-i> is interpreted as <tab> by terminals I moved it to i. sudo-tee#72

    focusing the input_window should restore to the previous position not
    the char before sudo-tee#64

commit 946af3a
Author: Francis Belanger <francis.belanger@gmail.com>
Date:   Sat Oct 18 15:11:17 2025 -0400

    fix(slash_commands): allow slash_commands to be entered in input window

    This should fix sudo-tee#71

commit abc1e2a
Author: Francis Belanger <francis.belanger@gmail.com>
Date:   Sat Oct 18 11:25:55 2025 -0400

    feat(completion): add folder icon kind

commit 031bf0a
Author: Francis Belanger <francis.belanger@gmail.com>
Date:   Sat Oct 18 11:12:19 2025 -0400

    feat: support for folder mentions

commit e99a463
Author: Francis Belanger <francis.belanger@gmail.com>
Date:   Thu Oct 16 16:34:41 2025 -0400

    feat(completion): add file search from server api

commit 601cc82
Author: Cameron Ring <cameron@cs.stanford.edu>
Date:   Thu Oct 9 15:52:47 2025 -0700

    fix(config): add config metatable (sudo-tee#59)

    Fixes sudo-tee#58

    Makes config access less error prone and more ergonomic

commit ca0ff90
Author: Francis Belanger <francis.belanger@gmail.com>
Date:   Thu Oct 9 09:50:28 2025 -0400

    chore: update .luarc.json for better support of emmylua_ls

commit a82b08c
Author: Francis Belanger <francis.belanger@gmail.com>
Date:   Thu Oct 9 09:49:28 2025 -0400

    fix: prefix replacement not working properly

commit 9d949e7
Author: Francis Belanger <francis.belanger@gmail.com>
Date:   Thu Oct 9 08:43:57 2025 -0400

    feat: add a keymap_prefix to configure the default `<leader>o`

commit 8c65d9b
Author: Cameron Ring <cameron@cs.stanford.edu>
Date:   Thu Oct 9 03:29:02 2025 -0700

    feat(config)!: modern keymap format + mode support (sudo-tee#52)

    This is a complete overhaul of the keymaps,

    The old config should still work but with a warning for migration

    The new format shoud now be:
    ```lua
     keymap = {
        editor = {
          ['<leader>og'] = { 'toggle' }, -- I don't think we really need to support just string, it makes things more complex for nothing
          ['<leader>oi'] = { 'open_input' },
          ['<leader>oI'] = { 'open_input_new_session' },
          ['<leader>oo'] = { 'open_output' },
          ['<leader>ot'] = { 'toggle_focus' },
          ['<leader>oq'] = { 'close' },
          ['<leader>os'] = { 'select_session' },
          ['<leader>op'] = { 'configure_provider' },
          ['<leader>od'] = { 'diff_open' },
          ['<leader>o]'] = { 'diff_next' },
          ['<leader>o['] = { 'diff_prev' },
          ['<leader>oc'] = { 'diff_close' },
          ['<leader>ora'] = { 'diff_revert_all_last_prompt' },
          ['<leader>ort'] = { 'diff_revert_this_last_prompt' },
          ['<leader>orA'] = { 'diff_revert_all' },
          ['<leader>orT'] = { 'diff_revert_this' },
          ['<leader>orr'] = { 'diff_restore_snapshot_file' },
          ['<leader>orR'] = { 'diff_restore_snapshot_all' },
          ['<leader>oC'] = { 'open_configuration_file' },
          ['<leader>ox'] = { 'swap_position' },
          ['<leader>opa'] = { 'permission_accept' },
          ['<leader>opA'] = { 'permission_accept_all' },
          ['<leader>opd'] = { 'permission_deny' },
        },
        output_window = {
          ['<leader>something'] = {function ()
                       -- custom code
          end},
          ['<esc>'] = { 'close' },
          ['<C-c>'] = { 'stop' },
          [']]'] = { 'next_message' },
          ['[['] = { 'prev_message' },
          ['<tab>'] = { 'toggle_pane', mode = { 'n', 'i' } },
          ['<C-i>'] = { 'focus_input' },
          ['<leader>oS'] = { 'select_child_session' },
          ['<leader>oD'] = { 'debug_message' },
          ['<leader>oO'] = { 'debug_output' },
          ['<leader>ods'] = { 'debug_session' },
        },
        input_window = {
          ['<cr>'] = { 'submit_input_prompt', mode = { 'n', 'i' } },
          ['<esc>'] = { 'close' },
          ['<C-c>'] = { 'stop' },
          ['~'] = { 'mention_file', mode = 'i' },
          ['@'] = { 'mention', mode = 'i' },
          ['/'] = { 'slash_commands', mode = 'i' },
          ['<tab>'] = { 'toggle_pane', mode = { 'n', 'i' } },
          ['<up>'] = { 'prev_prompt_history', mode = { 'n', 'i' } },
          ['<down>'] = { 'next_prompt_history', mode = { 'n', 'i' } },
          ['<M-m>'] = { 'switch_mode' },
          ['<leader>oS'] = { 'select_child_session' },
          ['<leader>oD'] = { 'debug_message' },
          ['<leader>oO'] = { 'debug_output' },
          ['<leader>ods'] = { 'debug_session' },
        },
        permission = {
          accept = 'a',
          accept_all = 'A',
          deny = 'd',
        },
    ```

commit fb33ce6
Author: Francis Belanger <francis.belanger@gmail.com>
Date:   Tue Oct 7 10:22:36 2025 -0400

    refactor: simplify keymaps by having a corresponding api function

commit fa31457
Author: Francis Belanger <francis.belanger@gmail.com>
Date:   Tue Oct 7 13:23:32 2025 -0400

    feat: restore mentions when navigating history
@cameronr cameronr deleted the feat/incremental-rendering branch November 6, 2025 01:21
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.

3 participants