fix: Add proxy health reuse guard, await child.exited for SSE stream#30
fix: Add proxy health reuse guard, await child.exited for SSE stream#30remy90 wants to merge 1 commit intoNomadcxx:mainfrom
Conversation
|
I believe this unrelated but I've noticed the following behaviour: ^I'm getting this quite often. I can look into this in more depth but would probably want to segment PRs, as streaming and writes now work, even if there are regular tool loop guard limits in place |
|
Thanks for this man, just saw this then. I'll check it out tomorrow afternoon when I'm back home. I tweaked the loop guard today, updated the prompt builder, reduced logging in main build .. so there is less looping, logging, errors overall from last few tests. Still very difficult to get tools and skills working correctly here because cursor-agent is a blackbox so its testing/iteration/refinement to see what works here and what doesn't (a real pain in the butt) but managed to one-shot a pong game in Go with Auto today. It's a crap model so it did poorly but it pulled the correct tools, wrote in the right directories seemed like it remembered context correctly.. we will get there soon I think I'm guessing another week. |
The plugin reuses an existing proxy on 127.0.0.1:32124 by checking
/health./healthdid not include workspace identity, so a proxy started in one workspace (e.g. ~/.config/opencode) could be reused by sessions in another workspace (e.g. ~/git/foo).Result:
cursor-agentruns with stale --workspace, and file writes are incorrectly blocked outside that stale directory.Root fix:
/healthincludes workspaceDirectoryawait child.exitedbefore deciding success vs error, preventing premature SSE termination.Adjacent SSE fix:
In Bun streaming path, completion/error decision relied on
child.exitCodedirectly, which can be null until process fully exits.This race can emit terminal/error behaviour prematurely and truncate SSE output.
Full disclosure, AI was used in this PR and I don't claim to have taken the time to understand Plugin.ts however, I have tested this for this machine and can confirm that this plugin now 'works on my machine'.