feat: add image generation, session tools, and background jobs#8
Conversation
- image_gen: generate images via agy built-in generate_image - setup: report agy install + auth status - session_transfer: expose the current agy conversation id - pre_finish_review: advisory pre-finish review (opencode has no blocking stop hook) - background jobs: detached runs with a file-backed job store, plus job_status/job_result/job_cancel and a background flag on the delegation tools - cross-platform process cleanup (taskkill /T on Windows)
|
Hey @TheLastAirbenderAng thanks for this, and for the thoughtful PR description. This is a genuinely well-crafted contribution. You offered to split it, and I'd like to take you up on that, because the pieces deserve different treatment. Here's where I landed on each:
This is actually a bugfix: the current process.kill(-pid) throws on Windows and orphans grandchildren. Your taskkill /T /F + signal-aware POSIX path is exactly right. A focused PR with just this and its tests gets merged quickly
Small, read-only, low risk. One question for the PR: does session_transfer earn a permanent tool slot given follow_up exists? If you've hit cases where resuming in the terminal beats follow_up, mention them in the PR body, that's the justification I need, since every tool schema costs every client context forever.
With those two changes, this is a clean merge.
The implementation is careful (atomic temp+rename, orphan scan, idempotent cancel), but there's a structural problem: the store serializes read-modify-writes with an in-process promise chain, while MCP stdio servers spawn one instance per client session. Two editor sessions running the bridge concurrently is the normal case, and their whole-file rewrites will silently clobber each other's jobs. That needs cross-process locking or per-process store files before it's safe. Two more things to address in the design:
Could you open this one as an issue/discussion first with your locking approach? I'm interested in the feature but want the multi-instance story solid before reviewing code. Also please let me know if I am missing something here for background jobs.
It's solving a real opencode gap, but it's prompt engineering that belongs in the client's system prompt, it overlaps adversarial_review, and it permanently costs every client context for an advisory nudge. agy-bridge's whole pitch is staying thin — I have to be strict about tool-count here. Again really appreciate the quality of this, especially from a first PR. The treeKill fix and image_gen (post-fixes) are things I want in. Looking forward to the split PRs. |
Hi! First-time contributor here. I've been using agy-bridge to delegate from opencode to agy, and ended up building a few things I kept reaching for. I know this is a sizable diff for a first PR — happy to split it into smaller pieces or rework anything.
What's added
generate_image. The prompt asks agy to end its reply with anIMAGE_PATH:line so the saved file is located deterministically, with a regex fallback to an absolute image path. Optionalnameslug andoutputcopy target. Returns the path plus an image content block.agy --conversation <id>resume command.job_status/job_result/job_canceland abackgroundflag on delegate/analyze_files/deep_search/web_lookup. Cancellation uses a cross-platform tree kill (taskkill /Ton Windows, process group on POSIX) and the store is written atomically.Notes
background: falsebehaves exactly as before.The
pre_finish_reviewandbackgroundnaming/shape are open for discussion if you'd rather they go a different direction. Thanks for the project — it's been really useful.