feat: add memory and self-assessment integration to supervisor (t128.6)#380
feat: add memory and self-assessment integration to supervisor (t128.6)#380marcusquinn merged 2 commits intomainfrom
Conversation
- Recall relevant memories before dispatch and inject into worker prompt - Store failure patterns (blocked/failed) via memory-helper.sh --auto - Store success patterns on task completion for future reference - Run batch retrospective on completion (stats, recurring errors, insights) - Add 'recall' command to preview memories for a task - Add 'retrospective' command for manual batch analysis - Wire memory storage into all pulse evaluation outcomes - Zero ShellCheck violations
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughAdded memory recall and storage capabilities to the supervisor script, including functions to fetch prior task memories, persist failure and success patterns, and run batch retrospectives. Integrated memory context into the dispatch flow and batch completion lifecycle. Changes
Sequence DiagramsequenceDiagram
participant Supervisor as Supervisor Script
participant Memory as Memory Helper
participant Dispatch as Dispatch Engine
Supervisor->>Memory: recall_task_memories(task_id)
Memory-->>Supervisor: task memories & patterns
Supervisor->>Dispatch: build_dispatch_cmd(..., memory_context)
Dispatch->>Dispatch: inject memory into prompt
Dispatch-->>Supervisor: enhanced dispatch command
Supervisor->>Dispatch: execute dispatch
Dispatch-->>Supervisor: outcome
Supervisor->>Memory: store_failure_pattern() or store_success_pattern()
Memory-->>Supervisor: pattern stored
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Fri Feb 6 05:19:02 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.agent/scripts/supervisor-helper.sh (1)
1107-1141:⚠️ Potential issue | 🔴 CriticalMulti-line prompt gets fragmented into separate CLI arguments.
build_dispatch_cmdoutputs one array element per line. Before this PR the prompt was a single line (/full-loop $task_id), soecho "$prompt"produced one line → one array element. Now, whenmemory_contextis non-empty, the prompt contains embedded newlines. Each line of the prompt becomes a separate element incmd_parts(via theread -rloop at Lines 1336-1338), so the CLI receives the prompt as multiple positional arguments instead of one.For example,
opencode run --format json --title t001 "/full-loop t001" "" "## Relevant Memories" "line2" ...— the memory context is not treated as part of the prompt argument.The safest fix is to use a NUL-delimited protocol between
build_dispatch_cmdand its consumer so newlines inside a single argument are preserved.🐛 Proposed fix: NUL-delimited output + `read -d ''` consumer
In
build_dispatch_cmd, replaceechowithprintf '%s\0':if [[ "$ai_cli" == "opencode" ]]; then - echo "opencode" - echo "run" - echo "--format" - echo "json" - echo "--title" - echo "$task_id" - echo "$prompt" + printf '%s\0' "opencode" "run" "--format" "json" "--title" "$task_id" "$prompt" else # claude CLI - echo "claude" - echo "-p" - echo "$prompt" - echo "--output-format" - echo "json" + printf '%s\0' "claude" "-p" "$prompt" "--output-format" "json" fiAnd update the consumer at Lines 1336-1338:
local -a cmd_parts=() - while IFS= read -r part; do + while IFS= read -r -d '' part; do cmd_parts+=("$part") done < <(build_dispatch_cmd "$task_id" "$worktree_path" "$log_file" "$ai_cli" "$memory_context")
🧹 Nitpick comments (1)
.agent/scripts/supervisor-helper.sh (1)
2590-2706: Solid retrospective implementation; minortrusage nit.Line 2663:
tr '\n' '; '—trmaps individual characters, so this maps newline→semicolon and the space in set2 is effectively ignored. The output will lack the intended space separator between error entries.🔧 Use `sed` or `paste` for the intended "; " delimiter
- retro_content+=" | Common errors: $(echo "$error_patterns" | tr '\n' '; ' | head -c 200)" + retro_content+=" | Common errors: $(echo "$error_patterns" | sed ':a;N;$!ba;s/\n/; /g' | head -c 200)"Or alternatively with
paste:- retro_content+=" | Common errors: $(echo "$error_patterns" | tr '\n' '; ' | head -c 200)" + retro_content+=" | Common errors: $(echo "$error_patterns" | paste -sd ';' - | sed 's/;/; /g' | head -c 200)"
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Fri Feb 6 05:24:26 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
|



Summary
Changes
Memory Recall Before Dispatch
recall_task_memories()queries memory-helper.sh for relevant memories before dispatching a workerbuild_dispatch_cmd()Failure/Success Pattern Storage
store_failure_pattern()stores blocked/failed outcomes viamemory-helper.sh --autostore_success_pattern()records completions (including retry count) for future referencesupervisor,<task_id>,<outcome_type>for targeted recallBatch Retrospective
run_batch_retrospective()runs automatically when a batch completessupervisor-helper.sh retrospective [batch_id]New Commands
recall <task_id>- Preview memories that would be injected for a taskretrospective [batch_id]- Run batch retrospective (defaults to most recent completed batch)Quality
local var="$1"pattern with explicit returnsTask
Closes t128.6 (Memory and self-assessment integration)
Summary by CodeRabbit
Release Notes