-
Notifications
You must be signed in to change notification settings - Fork 0
Comparing changes
Open a pull request
base repository: TheSDEs/opencode-morph-plugin
base: main
head repository: morphllm/opencode-morph-plugin
compare: main
- 20 commits
- 7 files changed
- 7 contributors
Commits on May 1, 2026
-
Configuration menu - View commit details
-
Copy full SHA for fe60b30 - Browse repository at this point
Copy the full SHA fe60b30View commit details
Commits on May 29, 2026
-
patch(compact): count reasoning in trigger threshold, drop it from co…
…mpact input estimateTotalChars now includes reasoning byte length so the threshold reflects what Anthropic actually charges as input_tokens. Without this, sessions with heavy reasoning (debug, planning) cross the model's degradation cliff (~200K tokens) silently before compaction fires. serializePart drops reasoning instead of forwarding to Morph compact API. Stale reasoning is the LLM's prior internal monologue \u2014 not worth tokens to summarize into the frozen block. The latest assistant turn's reasoning still lives in the uncompacted tail until next compaction. PLUGIN_VERSION bumped to 2.0.0-rate-reasoning-patch for visibility in logs. package.json version bumped to 2.0.9-reasoning-patch.
Configuration menu - View commit details
-
Copy full SHA for 090ec21 - Browse repository at this point
Copy the full SHA 090ec21View commit details -
feat(compact): /morph compact slash command to force compaction
Detects `/morph compact` (also /morph-compact, /morph_compact) at the start of a user message via the chat.message hook, strips it from the part text, and arms a module-level flag. The next experimental.chat.messages.transform invocation bypasses both threshold checks (first-compact and re-compact paths) and forces compaction. Flag is cleared regardless of success/failure. Useful when the trigger threshold is set conservatively (e.g. 200K tokens for Anthropic quality cliff) but the user wants to compact earlier — or to test the compact path without waiting for the threshold to be crossed. PLUGIN_VERSION → 2.0.1-rate-slash-compact package.json → 2.0.10-slash-compact
Configuration menu - View commit details
-
Copy full SHA for 3b8a60f - Browse repository at this point
Copy the full SHA 3b8a60fView commit details -
fix(compact): silence LLM reply after /morph compact
Previous placeholder "[/morph compact — manual compaction requested]" was indistinguishable from a real user request to the LLM, which dutifully produced a Markdown summary response (Goal / Constraints / Progress / ...). The user perceived this as a second compaction running on top of Morphs. Now: - If the user typed extra text after the command, keep that text and drop the command part entirely. - If the command was the entire message (the common case), replace it with an explicit no-reply directive phrased as an internal marker: "[internal: Morph compaction triggered in background. This is not a request; do not respond.]" Side benefit: messages.transform still sees a user turn (no empty-message backend issues), but the LLM no longer mistakes the placeholder for a summarization request. PLUGIN_VERSION -> 2.0.2-rate-slash-compact-silent package.json -> 2.0.11-slash-compact-silent
Configuration menu - View commit details
-
Copy full SHA for 27ed95c - Browse repository at this point
Copy the full SHA 27ed95cView commit details -
fix(compact): mutate output.messages in place — compaction was a no-op
ROOT CAUSE: opencode (packages/opencode/src/session/prompt.ts:1566) invokes the hook as yield* plugin.trigger("experimental.chat.messages.transform", {}, { messages: msgs }) and then ignores trigger.s return value, continuing to read msgs directly on line 1572 (MessageV2.toModelMessagesEffect(msgs, model)). The previous plugin code reassigned the local reference: output.messages = [...frozen, ...recent] which only updated the wrapper object passed to the hook. msgs (the original array opencode keeps using) was never mutated. The LLM kept receiving the full conversation despite Morph reporting "828 messages -> 3 frozen". EVIDENCE in trial DB ses_1c53c4870ffeSjEoAkn6vHiy53: Before first auto compact (00:06:01): cache.read=517972, total=518853 After first auto compact (00:08:04): cache.read=519046, total=521255 cache.read stayed flat. Anthropic saw the same prompt prefix. Compaction was silently a no-op end-to-end. FIX: helper replaceMessages(output, next) does output.messages.splice(0, output.messages.length, ...next) which mutates the same array reference opencode holds. All four assignment sites (under-threshold reuse, first compact, re-compact, re-compact failure fallback) are routed through it. Spread is replaced with a push loop above 50k elements as a stack-safety guard. PLUGIN_VERSION -> 2.0.3-rate-inplace-mutation package.json -> 2.0.12-inplace-mutationConfiguration menu - View commit details
-
Copy full SHA for 96452f8 - Browse repository at this point
Copy the full SHA 96452f8View commit details -
fix(compact): key compactionState by sessionID — subagents no longer …
…poisoned by parent ROOT CAUSE: compactionState and forceCompactOnNextTransform were module- level lets, shared across every session in the trial process. After the parent session compacted, every subsequent LLM call in any session (retries, subagents spawned via task tool) hit the same global. The transform hook then ran `replaceMessages(output, [...frozen, ...uncompacted])` where `frozen` came from the parent and `uncompacted` was the subagent's tiny new messages array — overwriting the subagent's actual prompt with the parent's frozen block. OBSERVED: 3 explore subagents spawned at 01:35 with completely different review prompts ALL answered the same unrelated question about FFI/WASM flash API — which was the dominant topic captured in the parent's frozen block from its 01:01 compaction. NOTE: only became visible AFTER v2.0.3 (in-place replaceMessages). v2.0.0- 2.0.2 had the same global-state bug, but their `output.messages = [...]` reassignment was ignored by opencode (it reads `msgs` not `output`), so the poisoned messages array never reached the LLM. v2.0.3 fixed reference preservation and exposed the latent global-state bug. FIX: compactionStateBySession = Map<sessionID, CompactionState>; ditto for forceCompactBySession. transform hook reads sessionID off messages[0].info.sessionID (SDK guarantees the field). chat.message hook reads sessionID directly from input. If sessionID is unavailable, transform degrades to no-op — safer than touching another session's state.
Configuration menu - View commit details
-
Copy full SHA for aa73443 - Browse repository at this point
Copy the full SHA aa73443View commit details
Commits on Jun 1, 2026
-
Merge pull request morphllm#17 from morphllm/fix/issue-13-compact-event
Fix Morph handling of OpenCode compaction events
Configuration menu - View commit details
-
Copy full SHA for dbc6d62 - Browse repository at this point
Copy the full SHA dbc6d62View commit details -
Configuration menu - View commit details
-
Copy full SHA for a0235a3 - Browse repository at this point
Copy the full SHA a0235a3View commit details
Commits on Jun 2, 2026
-
fix: bump @morphllm/morphsdk to latest to fix WarpGrep failures (morp…
…hllm#9) (morphllm#20) Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Configuration menu - View commit details
-
Copy full SHA for 330353b - Browse repository at this point
Copy the full SHA 330353bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 966590a - Browse repository at this point
Copy the full SHA 966590aView commit details -
chore: track bun.lock in version control (morphllm#21)
bun.lock was gitignored, so the SDK bump in morphllm#20 only updated package-lock.json. Track bun.lock so bun users get the pinned dependency tree too. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Configuration menu - View commit details
-
Copy full SHA for 15d45e4 - Browse repository at this point
Copy the full SHA 15d45e4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 79dcb11 - Browse repository at this point
Copy the full SHA 79dcb11View commit details -
feat: allow API key via opencode config file (morphllm#11) (morphllm#22)
Desktop users can set `morph.apiKey` in opencode.json instead of the MORPH_API_KEY env var. Env var still takes precedence. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Configuration menu - View commit details
-
Copy full SHA for 1530983 - Browse repository at this point
Copy the full SHA 1530983View commit details -
Configuration menu - View commit details
-
Copy full SHA for d7d5446 - Browse repository at this point
Copy the full SHA d7d5446View commit details
Commits on Jun 14, 2026
-
fix: await async generator return value in warpgrep_codebase_search
The morphsdk WarpGrepClient.execute() async generator returns a Promise from processAgentResult() via `return promise`. Node.js auto-awaits it per ECMAScript spec, but Bun does not — the unresolved Promise becomes the .next() value. Without the explicit await, result was a Promise whose .success was undefined, and formatWarpGrepResult returned the generic failure message: "Search failed: search returned no error details." The fix is a single line: `result = await value`. This is harmless on Node.js (await on a non-Promise is a no-op) and resolves the Promise on Bun. Closes morphllm#24
Configuration menu - View commit details
-
Copy full SHA for 9a8d60a - Browse repository at this point
Copy the full SHA 9a8d60aView commit details
Commits on Jun 17, 2026
-
Merge pull request morphllm#25 from fpdy/fix/warpgrep-snapshot-worktr…
…ee-fallback fix: await async generator return value in warpgrep_codebase_search (Bun compatibility Issue)
Configuration menu - View commit details
-
Copy full SHA for 27208e7 - Browse repository at this point
Copy the full SHA 27208e7View commit details -
Configuration menu - View commit details
-
Copy full SHA for e25f748 - Browse repository at this point
Copy the full SHA e25f748View commit details -
Merge origin/main into fix/compact-force-and-per-session-state
Reconcile the per-session compaction work with main's native-compaction rework. Both code paths now coexist: - chat.message `/morph compact` slash command (force-compact) and the session.compacted event handler are kept as separate hooks; the event handler now clears per-session state (compactionStateBySession) instead of the removed global. - sessionID is resolved once at the top of the transform hook so the native-compaction branch can use replaceMessages() (the in-place no-op fix) and clear its own session's frozen block. - Compaction log lines keep the per-session context and adopt main's formatCompressionPercent() helper. - PLUGIN_VERSION restored to main's value (dropped the dev label). typecheck clean; 67/67 tests pass.
Configuration menu - View commit details
-
Copy full SHA for cbafd9a - Browse repository at this point
Copy the full SHA cbafd9aView commit details -
Merge pull request morphllm#19 from tracycam/fix/compact-force-and-pe…
…r-session-state fix(compact): make compaction effective, per-session state, and add /morph compact trigger
Configuration menu - View commit details
-
Copy full SHA for 54e20d0 - Browse repository at this point
Copy the full SHA 54e20d0View commit details -
Configuration menu - View commit details
-
Copy full SHA for aac111a - Browse repository at this point
Copy the full SHA aac111aView commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff main...main