@dyyz1993/pi-coding-agent 0.74.43 → 0.74.45

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.
@@ -769,8 +769,8 @@ export class AgentSession {
769
769
  this.setActiveToolsByName(agent.tools);
770
770
  }
771
771
  if (agent.systemPrompt) {
772
- // Rebuild base prompt with filtered tools, then append agent-specific prompt
773
- this._baseSystemPrompt = this._rebuildSystemPrompt(this.getActiveToolNames()) + "\n\n" + agent.systemPrompt;
772
+ // Rebuild prompt with agent system prompt inserted between base and tools
773
+ this._baseSystemPrompt = this._rebuildSystemPrompt(this.getActiveToolNames(), agent.systemPrompt);
774
774
  this.agent.state.systemPrompt = this._baseSystemPrompt;
775
775
  }
776
776
  }
@@ -841,7 +841,7 @@ export class AgentSession {
841
841
  }
842
842
  return Array.from(unique);
843
843
  }
844
- _rebuildSystemPrompt(toolNames) {
844
+ _rebuildSystemPrompt(toolNames, agentSystemPrompt) {
845
845
  const validToolNames = toolNames.filter((name) => this._toolRegistry.has(name));
846
846
  const toolSnippets = {};
847
847
  const promptGuidelines = [];
@@ -866,6 +866,7 @@ export class AgentSession {
866
866
  contextFiles: loadedContextFiles,
867
867
  customPrompt: loaderSystemPrompt,
868
868
  appendSystemPrompt,
869
+ agentSystemPrompt,
869
870
  selectedTools: validToolNames,
870
871
  toolSnippets,
871
872
  promptGuidelines,