@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 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
- - **Read-only**: You NEVER modify files. You report findings for the code agent to fix
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 last assistant message for context passing
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 lastAssistant = messages.filter(m => m.role === 'assistant').pop();
883
- let lastOutput = '';
884
- if (lastAssistant?.content) {
885
- const textParts = Array.isArray(lastAssistant.content)
886
- ? lastAssistant.content.filter((c: any) => c.type === 'text').map((c: any) => c.text)
887
- : [String(lastAssistant.content)];
888
- lastOutput = textParts.join('\n').slice(0, 3000);
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phi-code-admin/phi-code",
3
- "version": "0.70.0",
3
+ "version": "0.71.0",
4
4
  "description": "Coding agent CLI with read, bash, edit, write tools and session management",
5
5
  "type": "module",
6
6
  "piConfig": {