Repository navigation
Feature idea: expose an idle + explicit-span compaction entry point (idle compactRegion)
#12813
DerekZhangbj
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi — thanks for open-sourcing this; "everything is a plugin" has made it very pleasant to build on.
The gap
Compaction currently has two halves, and neither alone can express "compact exactly this finished span while the agent is idle":
compactNow(agent, signal, sourceCommandId?)— idle-friendly, but the span is chosen byselectCompactableRange, which only takes a prefix (and keeps the priced tail).compactRegion(start, end, agent, signal?)— takes an explicit span, but requires an open turn (owner: "current-turn",stability: "whole-surface")./compact— stillUSAGE = 'Usage: /compact (no arguments)'.GUI surfaces (composer buttons, plugin panels, slash commands) act while the agent is idle, so they can't call
compactRegion, andcompactNowcan't target the span the user picked. The span people usually want to drop is a recent side branch (a debugging detour, a dead end), not the oldest prefix.What a community plugin had to do
I maintain
dsh-compaction-selective(https://github.com/DerekZhangbj/dsh-compaction-selective): the user names the span, a confirmation card is shown, then the span is folded. For the idle path it patchesdsh-compaction-basicwith ~15 lines that mirrorcompactNow's manual path:That works on a CLI install (verified on
0.2.0-rc.2,0.2.1-rc.2).Why an official entry point would matter more than a patch
The desktop app bundles the core inside
app.asar. Third-party plugins cannot patch it, and even on the CLI a local patch is wiped by every upgrade. So for the desktop app the plugin has to degrade: the panel disables the actions and tells the user to use the conversation form instead. Every desktop user of any plugin that wants idle-span compaction hits the same wall.The ask
Expose a supported entry point for idle + explicit span compaction — e.g. a
compactRange(start, end, agent, signal?, sourceCommandId?)method onCompactionEngine(or an option oncompactRegionsuch asowner: null). If there's already a sanctioned way to do this that I missed, pointing me at it would be just as good.I'm happy to open a PR — I read
CONTRIBUTING.mdand understand external PRs are paused at the moment, so I'm posting here first. No expectations on timing; I mainly want to know whether this is a direction you'd accept, and what shape you'd prefer.Context if useful: my compatibility notes with the exact tags/SHAs inspected are in
COMPATIBILITY-AUDIT.mdin the repo above.All reactions