Skip to content

[FIX] compaction call signature #125

Description

@four-bytes-robby

Problem

The client.session.summarize call in src/four-opencode-context-curator.ts is using the wrong arguments. This is likely why compact_now signals don't trigger the native /compact command — the internal SDK method is being called with an incorrect signature, causing the compaction to silently fail or never execute.

Expected Behavior

The call to client._session.client.session.summarize() should match the internal opencode SDK call signature. Based on the opencode source (packages/opencode/src/session/prompt.ts:1436 and packages/opencode/src/session/compaction.ts:384), the correct invocation needs to be verified against the actual method signature.

Impact

  • compact_now signals emitted by the context curator do not trigger real compaction
  • Users may not realize their context is growing unbounded because the compaction signal appears to work but doesn't actually invoke session.summarize()

Action Required

  1. Verify the correct call signature for session.summarize() against packages/opencode/src/session/compaction.ts
  2. Fix the argument order / parameters in four-opencode-context-curator.ts
  3. Test that a compact_now signal actually triggers native opencode compaction

References

  • opencode-src compaction agent: packages/opencode/src/agent/prompt/compaction.txt
  • opencode-src compaction call site: packages/opencode/src/session/compaction.ts:384
  • session.summarize() entry point: packages/opencode/src/session/compaction.ts

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions