You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit be1a68a
Browse filesBrowse the repository at this point in the historyBrowse files
fix(audit): address Athena council findings from solo v0.10.1+ audit
Council flagged concrete correctness and observability bugs introduced (or
left untouched) by the recent tokenizer/sidebar work. All fixes apply to
uncommitted changes so no shipped behavior regresses.
Correctness fixes:
- `strip-content.ts` — `stripReasoningFromMergedAssistants` now strips
`thinking` and `redacted_thinking` part types in addition to OpenCode's
internal `reasoning`. Opus 4.7 emits wire-format `thinking` parts, and the
workaround's whole purpose (keep thinking at position 0 in the merged
Anthropic block) requires handling every reasoning-like type. Without
this, two consecutive assistants each carrying a `thinking` block pass
through unchanged and produce the exact "thinking blocks … cannot be
modified" 400 the function was written to prevent. Adds 3 new tests
covering `thinking`-typed consecutive runs and mixed type sequences.
- `messages-transform.ts` — distinguish SQLITE_BUSY (transient, log and
skip) from persistent non-BUSY errors (log with full detail and persist a
summary into `session_meta.last_transform_error`). The sidebar already
reads that field, so persistent schema/programming failures now surface
as a visible failure indicator instead of disabling magic-context
silently forever.
- `event-handler.ts` + `event-payloads.ts` — invalidate the per-message
token cache on `message.updated` (per-message, falls back to session-wide
when the event lacks a message id) and on `session.compacted`
(session-wide, since native compaction restructures messages).
`MessageUpdatedAssistantInfo` gains an optional `messageID` sourced from
`info.id`.
Hardening fixes:
- `inject-compartments.ts` — memory trim-to-budget now uses `estimateTokens`
instead of chars/4, matching the rest of the plugin's token math. Removes
the last unit-mismatched budget path in the injection pipeline.
- `image-token-estimate.ts` — `readUint32BE` now coerces via `>>> 0` so
PNG headers with MSB-set bytes produce the correct unsigned value
instead of a negative int that bypasses the `< 1` fallback. Removes
dead `|| 0` in the WebP lossy parser; the `& 0x3fff` mask already
produces a non-negative result.
Tests:
- `transform-index-staleness.test.ts` — the "clears reasoning before
dropped messages" regression expected `m-reason-b`'s `thinking` to
survive after pruning, but that expectation was only valid while
`stripReasoningFromMergedAssistants` ignored `thinking` parts (the bug
fixed in #2 above). Updated the assertion and comment to reflect the
correct interaction: after pruning collapses adjacent assistants, the
merge-strip correctly removes `thinking` from every assistant past the
first in the run, even when the watermark wouldn't reach it.
Verified: 535 plugin tests pass, typecheck clean, build clean, lint clean
(pre-existing Intentional: warnings only).
Skipped findings (documented in synthesis.md):
- #10 self-heal oscillation (sticky-date already stabilizes main variance)
- #11 non-image attachments counted as 0 (would require document tokenization)
- #12 residual clamp masks drift (clamp-to-0 is more user-friendly than negative)
0 commit comments