@phi-code-admin/phi-code 0.70.0 → 0.71.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agents/review.md +2 -2
- package/extensions/phi/orchestrator.ts +17 -8
- package/package.json +1 -1
package/agents/review.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: review
|
|
3
3
|
description: Senior code reviewer. Audits quality, security, performance, and correctness.
|
|
4
|
-
tools: read, write, grep, find, ls, bash, memory_search, memory_write, ontology_add
|
|
4
|
+
tools: read, write, edit, grep, find, ls, bash, memory_search, memory_write, ontology_add
|
|
5
5
|
model: default
|
|
6
6
|
---
|
|
7
7
|
|
|
@@ -31,7 +31,7 @@ Focus your review on the files mentioned in previous task results. Don't audit t
|
|
|
31
31
|
- **Specific references**: File path, line number, exact code snippet. Generic advice is useless
|
|
32
32
|
- **Severity levels**: Critical (must fix before deploy), High (fix soon), Medium (improve), Low (nice-to-have)
|
|
33
33
|
- **Actionable suggestions**: Don't just say "this is bad" — show the fix
|
|
34
|
-
- **
|
|
34
|
+
- **Fix what you find**: When you discover bugs, fix them using `edit` (preferred for surgical changes) or `write` (for larger rewrites). Don't just report — act
|
|
35
35
|
- **Focused scope**: Review what was changed, not the entire project
|
|
36
36
|
|
|
37
37
|
## File Writing
|
|
@@ -877,16 +877,25 @@ Tag the note with relevant keywords for vector search.`,
|
|
|
877
877
|
pi.on("agent_end", async (event, ctx) => {
|
|
878
878
|
if (!orchestrationActive || !phasePending) return;
|
|
879
879
|
|
|
880
|
-
// Capture
|
|
880
|
+
// Capture the most informative assistant message for context passing
|
|
881
|
+
// The last message is often trivial ("Good, file created."). Find the longest
|
|
882
|
+
// text-only assistant message instead — that's usually the real analysis/plan.
|
|
881
883
|
const messages = event.messages || [];
|
|
882
|
-
const
|
|
883
|
-
let
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
884
|
+
const assistantMessages = messages.filter(m => m.role === 'assistant');
|
|
885
|
+
let bestOutput = '';
|
|
886
|
+
let bestLength = 0;
|
|
887
|
+
for (const msg of assistantMessages) {
|
|
888
|
+
if (!msg.content) continue;
|
|
889
|
+
const textParts = Array.isArray(msg.content)
|
|
890
|
+
? msg.content.filter((c: any) => c.type === 'text').map((c: any) => c.text)
|
|
891
|
+
: [String(msg.content)];
|
|
892
|
+
const combined = textParts.join('\n');
|
|
893
|
+
if (combined.length > bestLength) {
|
|
894
|
+
bestLength = combined.length;
|
|
895
|
+
bestOutput = combined;
|
|
896
|
+
}
|
|
889
897
|
}
|
|
898
|
+
const lastOutput = bestOutput.slice(0, 4000);
|
|
890
899
|
|
|
891
900
|
// Inject previous phase output into next phase
|
|
892
901
|
if (lastOutput && phaseQueue.length > 0) {
|