refactor(agents): upgrade hotplex to v0.7.4 and restructure System Prompt#277
Merged
Conversation
- 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TaskSystemPromptrenamed toTaskInstructionsHotPlexClientinterface instead of concrete*EngineBaseSystemPrompt: Engine-level, fixed DivineSense context + mode-specific rulesTaskInstructions: User context, set on each requestdivinesense-geek) and EvolutionMode (divinesense-evolution)Changes
Core Changes
cc_runner.go: Add functional options pattern (WithAdminToken,WithBaseSystemPrompt,WithNamespace)cc_runner.go: RenameSystemPrompttoTaskInstructionsinCCRunnerConfiggeek/parrot.go: Simplify TaskInstructions handlinggeek/evolution.go: AddPermissionMode: "bypassPermissions"geek/mode.go: AddBaseSystemPrompt()andBuildContextPrompt()methodsDependency
Test plan
go build ./...passesgo test ./ai/...passes🤖 Generated with Claude Code