Skip to content

feat(wire): integrate openclaude context primitives - #253

Merged
Patel230 merged 1 commit into
mainfrom
feat/openclaude-wiring
Aug 24, 2026
Merged

feat(wire): integrate openclaude context primitives#253
Patel230 merged 1 commit into
mainfrom
feat/openclaude-wiring

Conversation

@Patel230

Copy link
Copy Markdown
Contributor

Summary

Wires all four OpenClaude-adopted primitives (from PR #252) into hawk's running system.

circuitbreaker -> auto-compaction

  • AutoCompactor (internal/engine/compact_auto.go) now uses the circuitbreaker package instead of a plain consecutive-failure int: adds the missing cooldown + half-open auto-retry (3 failures -> cooldown window -> half-open probe that a single failure re-opens). CompactConfig gains Cooldown (default 5m). Existing TestAutoCompactor_CircuitBreaker preserved (updated to the new API, same behavior).

relevanceprune -> compaction

  • New RelevancePruneStrategy (internal/engine/compact_relevance.go) registered in the compaction registry between smart and truncate. Scores older messages against the last user turn, keeps the highest-relevance groups up to budget, preserves recent tail + tool calls + errors; degrades to truncation.

smartrouting -> per-turn model selection

  • Settings.SmartRouting *smartrouting.Config (settings.json smart_routing), wired via LifecycleService.SetSmartRouting, applied in the stream model-cascade block (stream.go) — cheap simple model for trivial turns, strong otherwise, fail-toward-strong.

conversationarc -> durable session sidecar

  • Session gains SetArc/Arc; loaded on session open (cmd/chat.go), saved on session close (cmd/chat_commands_session.go), and the byte-stable Summary() injected into the system prompt (stream.go buildTurnOptions) — empty arcs inject nothing.

Verification

  • New tests: circuit-breaker cooldown/half-open, relevance strategy + adapter, smartrouting reroute, session arc accessors + IsEmpty
  • go build ./..., go vet, full engine/config/cmd/conversationarc/circuitbreaker/smartrouting/relevanceprune suites green
  • Boundary guard + govulncheck + full pre-push test suite green

@Patel230
Patel230 merged commit 384224d into main Aug 24, 2026
26 checks passed
@Patel230
Patel230 deleted the feat/openclaude-wiring branch August 24, 2026 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant