GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: configurable compaction by maxeonyx · Pull Request #4149 · anomalyco/opencode

Conversation

@maxeonyx

@maxeonyx maxeonyx commented Nov 10, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

This will help to address the many issues about compaction

Closes #3031

I have had great success using this version with a custom "handover" compact prompt.

example: override /compact with compact.md

This will now affect auto-compaction.

~/.config/opencode/command/compact.md

---
description: my custom compact
compact: true
---

Provide a detailed summary focusing on ...

example: custom command /handover

~/.config/opencode/command/handover.md

---
description: handover to new agent
compact: true
---

Produce a handoff note from this conversation ...

example: set auto-compact to use /handover

~/.config/opencode/opencode.json

{
  "compaction": {
    "command": "handover"
  }
}

I have spent a lot of time making this PR as small and well integrated as possible, as I'm relying on it for my day-to-day work.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

istarkov and arsham reacted with thumbs up emoji arsham reacted with heart emoji
All reactions
  • 👍 2 reactions
  • ❤️ 1 reaction
@maxeonyx maxeonyx changed the title feat: add handover mode to /compact command feat: make /compact prompt configurable via compactPrompt config Nov 10, 2025
@maxeonyx
maxeonyx force-pushed the feature/compact-handover-mode branch from 55d51e3 to 03211fa Compare November 10, 2025 00:34
@github-actions
github-actions Bot force-pushed the dev branch from 772b621 to eb855e1 Compare November 10, 2025 05:42
@rekram1-node

rekram1-node commented Nov 11, 2025

Copy link
Copy Markdown
Member

@maxeonyx have u seen how we handle /init?

I was thinking a cleaner solution here would be to make compact a built in slash command, a user could override the prompt by defining their own compact and it wouldn't require additional config fields

The main change this would require is allowing slash commands to register functions to execute, which ofc couldn't be done in json but perhaps for now that functionality would remain internal

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@maxeonyx

maxeonyx commented Nov 11, 2025

Copy link
Copy Markdown
Author

I haven't seen that, no, but I assumed compact has special handling due to the fact that it replaces the full context window. I am very open to doing this a different way.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@maxeonyx

maxeonyx commented Nov 11, 2025

Copy link
Copy Markdown
Author

@rekram1-node in your suggestion, then, I would define my own /handover slash command, with a different prompt, and configured to remove the rest of the context same as /compact (and we would also make /compact be implemented the same way)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@maxeonyx
maxeonyx force-pushed the feature/compact-handover-mode branch from 03211fa to 10a1998 Compare November 11, 2025 23:23
@github-actions
github-actions Bot force-pushed the dev branch 3 times, most recently from f1dc981 to 3e15a39 Compare November 22, 2025 18:07
@thdxr
thdxr force-pushed the dev branch from 3e15a39 to a0831ea Compare November 22, 2025 18:11
@github-actions
github-actions Bot force-pushed the dev branch 3 times, most recently from f8ee907 to 6a9856d Compare November 27, 2025 01:29
@einarpersson

einarpersson commented Nov 28, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

@rekram1-node

@maxeonyx have u seen how we handle /init?

I was thinking a cleaner solution here would be to make compact a built in slash command, a user could override the prompt by defining their own compact and it wouldn't require additional config fields

The main change this would require is allowing slash commands to register functions to execute, which ofc couldn't be done in json but perhaps for now that functionality would remain internal

I agree, I think
1.compact should be a default includes slash command
2. Default included slash commands should be able to be overriden by user custom commands
3. User custom commands should be able to run as functions, something like #4411

I would advocate for trying to build the built-in slash commands such as /compact with the sdk, in other words forcing yourself to use the same functionality that a custom plugin developer would use. That would drive a architecture which makes sure that user custom commands can be just as powerful as the ones provided by default.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rekram1-node

rekram1-node commented Dec 1, 2025

Copy link
Copy Markdown
Member

Yup total agreement, currently jumping between several fixes and then I can come back to these new feature prs

einarpersson reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@maxeonyx

maxeonyx commented Dec 2, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Author

I have the new version mostly implemented but I'm on holiday atm - feel free to take it over or close as I won't able to do the final "runnable as functions" part. But I have done the "custom md file to implement custom compact-type command". I can add precedence for overriding /compact - that's a good idea.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rekram1-node
rekram1-node force-pushed the dev branch from 398b39a to 5013d64 Compare December 5, 2025 05:13
@maxeonyx
maxeonyx force-pushed the feature/compact-handover-mode branch from 10a1998 to 0ee7d14 Compare December 7, 2025 23:25
@maxeonyx
maxeonyx marked this pull request as draft December 7, 2025 23:36
@maxeonyx maxeonyx changed the title feat: make /compact prompt configurable via compactPrompt config feat: support custom compact commands via markdown files Dec 7, 2025
@maxeonyx maxeonyx changed the title feat: support custom compact commands via markdown files feat: support custom /compact via markdown files Dec 7, 2025
@maxeonyx
maxeonyx marked this pull request as ready for review December 8, 2025 02:36
@maxeonyx
maxeonyx force-pushed the feature/compact-handover-mode branch from d47ece7 to 69bcc27 Compare December 8, 2025 03:36
@maxeonyx

maxeonyx commented Dec 8, 2025

Copy link
Copy Markdown
Author

@rekram1-node @einarpersson This PR is ready for your review, hope it's what you are imagining. It has turned out pretty clean I think.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@maxeonyx
maxeonyx force-pushed the feature/compact-handover-mode branch 2 times, most recently from bd56afe to ec204d7 Compare December 12, 2025 01:23
@maxeonyx maxeonyx changed the title feat: support custom /compact via markdown files feat: support custom /compact commands via configuration Dec 12, 2025
@maxeonyx maxeonyx changed the title feat: support custom /compact commands via configuration feat: support custom /compact commands Dec 12, 2025
@maxeonyx
maxeonyx force-pushed the feature/compact-handover-mode branch from b574f2b to 6df3686 Compare December 16, 2025 03:07
@maxeonyx

maxeonyx commented Dec 17, 2025

Copy link
Copy Markdown
Author

@rekram1-node Keeping this up-to date is becoming a hassle - would you be able to review?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added the needs:issue label Jan 12, 2026
@github-actions

github-actions Bot commented Jan 12, 2026

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot removed the needs:issue label Jan 12, 2026
@maxeonyx maxeonyx changed the title feat: support custom /compact commands feat: configurable compaction Jan 12, 2026
@maxeonyx maxeonyx mentioned this pull request Jan 12, 2026
Model in BUILD mode does not have enough context to continue after compaction #3031
Closed
@maxeonyx
maxeonyx force-pushed the feature/compact-handover-mode branch 3 times, most recently from d9e801f to 6e8d1e1 Compare January 14, 2026 21:42
@maxeonyx
maxeonyx force-pushed the feature/compact-handover-mode branch from 6e8d1e1 to 61cac9e Compare January 21, 2026 09:42
@maxeonyx
feat: configurable compaction
55cde50
@maxeonyx
maxeonyx force-pushed the feature/compact-handover-mode branch from 61cac9e to 55cde50 Compare January 27, 2026 01:21
@maxeonyx maxeonyx closed this Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Model in BUILD mode does not have enough context to continue after compaction

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@maxeonyx @rekram1-node @einarpersson
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.