Skip to content

refactor(agents): upgrade hotplex to v0.7.4 and restructure System Prompt#277

Merged
hrygo merged 8 commits into
mainfrom
feat/refactor-hotplex
Feb 21, 2026
Merged

refactor(agents): upgrade hotplex to v0.7.4 and restructure System Prompt#277
hrygo merged 8 commits into
mainfrom
feat/refactor-hotplex

Conversation

@hrygo

@hrygo hrygo commented Feb 21, 2026

Copy link
Copy Markdown
Owner

Summary

  • Upgrade hotplex from v0.6.3 to v0.7.4
  • Adapt to hotplex API changes:
    • TaskSystemPrompt renamed to TaskInstructions
    • Session-level persistence for TaskInstructions
    • HotPlexClient interface instead of concrete *Engine
  • Restructure System Prompt architecture:
    • BaseSystemPrompt: Engine-level, fixed DivineSense context + mode-specific rules
    • TaskInstructions: User context, set on each request
  • Add namespace isolation for GeekMode (divinesense-geek) and EvolutionMode (divinesense-evolution)
  • Simplify TaskInstructions handling - remove unnecessary sync.Map tracking

Changes

Core Changes

  • cc_runner.go: Add functional options pattern (WithAdminToken, WithBaseSystemPrompt, WithNamespace)
  • cc_runner.go: Rename SystemPrompt to TaskInstructions in CCRunnerConfig
  • geek/parrot.go: Simplify TaskInstructions handling
  • geek/evolution.go: Add PermissionMode: "bypassPermissions"
  • geek/mode.go: Add BaseSystemPrompt() and BuildContextPrompt() methods

Dependency

  • hotplex: v0.6.3 → v0.7.4

Test plan

  • go build ./... passes
  • go test ./ai/... passes
  • golangci-lint passes
  • Manual test with GeekMode

🤖 Generated with Claude Code

hotplex-ai and others added 8 commits February 21, 2026 23:49
- Update hotplex dependency from v0.6.3 to v0.7.1
- Adapt CCRunner to new hotplex API:
  - Use HotPlexClient interface instead of concrete *Engine type
  - Update SetDangerBypassEnabled to require admin token (string, bool) -> error
  - Remove deprecated type aliases (Detector, Session, SessionStatus, DangerLevel, DangerBlockEvent)
  - Remove deprecated constants (SessionStatus*, DangerLevel*)
  - Remove GetDangerDetector method (internal type not exported)
- Add adminToken field to CCRunner for bypass mode support

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add CCRunnerOption functional options pattern for NewCCRunner
- Add WithAdminToken option to configure bypass token
- Add DIVINESENSE_GEEK_ADMIN_TOKEN environment variable
- Fix EvolutionParrot missing PermissionMode: bypassPermissions
- Both GeekParrot and EvolutionParrot now properly support bypass mode

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…c prompts

- Add WithBaseSystemPrompt option to NewCCRunner
- Split SystemPrompt into:
  - BaseSystemPrompt (fixed, set at engine creation via EngineOptions)
  - TaskSystemPrompt (dynamic, set per-execute for user context)
- Update CCMode interface with BaseSystemPrompt() method
- GeekMode: BaseSystemPrompt = Output Behavior rules
- EvolutionMode: BaseSystemPrompt = full decision tree
- GeekParrot: TaskSystemPrompt = user context (workdir, session, etc.)
- EvolutionParrot: TaskSystemPrompt = empty (no dynamic context)
- handler.go: Create mode instances and pass BaseSystemPrompt to NewCCRunner

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add WithNamespace CCRunnerOption for UUID v5 namespace configuration
- GeekMode uses namespace "divinesense-geek"
- EvolutionMode uses namespace "divinesense-evolution"
- Ensures physical isolation between modes via deterministic session IDs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Architecture Decision:
1. BaseSystemPrompt (Engine creation, fixed):
   - DivineSenseBaseContext: system intro + interaction mode + language
   - Mode-specific rules: GeekMode Output Behavior, EvolutionMode Decision Tree

2. TaskSystemPrompt (First session creation only):
   - User ID, Client Device, User Agent, Server OS, Workspace, Session
   - Injected only on first Execute(), empty on subsequent requests

3. Subsequent requests: Only user prompt, no system context injection

Changes:
- Add DivineSenseBaseContext constant for fixed system context
- Add BuildUserContextPrompt() for dynamic user context (time excluded)
- Update GeekMode.BaseSystemPrompt() to include DivineSenseBaseContext
- Update EvolutionMode.BaseSystemPrompt() to include DivineSenseBaseContext
- Add GeekParrot.initialized field to track first session
- GeekParrot.Execute(): inject TaskSystemPrompt only on first call

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove sync.Map tracking - unnecessary complexity
- Simply set TaskInstructions on every request
- hotplex v0.7.2 handles session-level persistence internally
- Values are identical each time, so overwrite has no impact

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@hrygo hrygo merged commit 4834f5f into main Feb 21, 2026
6 of 8 checks passed
@hrygo hrygo deleted the feat/refactor-hotplex branch February 21, 2026 17:52
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.

2 participants