astrocode-workflow 0.1.23 → 0.1.24

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.
@@ -154,16 +154,12 @@ export function createAstroWorkflowProceedTool(opts) {
154
154
  return false;
155
155
  };
156
156
  if (!agentExists(agentName)) {
157
- console.warn(`[Astrocode] Agent ${agentName} not found in config. Falling back to General.`);
157
+ console.warn(`[Astrocode] Agent ${agentName} not found in config. Falling back to orchestrator instead of General.`);
158
158
  console.warn(`[Astrocode] Agent check: config.agent exists: ${!!systemConfig.agent}, agentName in config: ${systemConfig.agent ? agentName in systemConfig.agent : 'N/A'}`);
159
- agentName = "General";
160
- // Second fallback to orchestrator if General also unavailable
159
+ // Skip General fallback for stage agents to avoid malformed output
160
+ agentName = config.agents?.orchestrator_name || "Astro";
161
161
  if (!agentExists(agentName)) {
162
- console.warn(`[Astrocode] General agent also unavailable. Falling back to orchestrator.`);
163
- agentName = config.agents?.orchestrator_name || "Astro";
164
- if (!agentExists(agentName)) {
165
- throw new Error(`Critical: No agents available for delegation. Primary: ${resolveAgentName(next.stage_key, config)}, General, Orchestrator: ${agentName}`);
166
- }
162
+ throw new Error(`Critical: No agents available for delegation. Primary: ${resolveAgentName(next.stage_key, config)}, Orchestrator: ${agentName}`);
167
163
  }
168
164
  }
169
165
  console.log(`[Astrocode] Delegating stage ${next.stage_key} to agent: ${agentName}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astrocode-workflow",
3
- "version": "0.1.23",
3
+ "version": "0.1.24",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -187,19 +187,15 @@ export function createAstroWorkflowProceedTool(opts: { ctx: any; config: Astroco
187
187
  return false;
188
188
  };
189
189
 
190
- if (!agentExists(agentName)) {
191
- console.warn(`[Astrocode] Agent ${agentName} not found in config. Falling back to General.`);
192
- console.warn(`[Astrocode] Agent check: config.agent exists: ${!!systemConfig.agent}, agentName in config: ${systemConfig.agent ? agentName in systemConfig.agent : 'N/A'}`);
193
- agentName = "General";
194
- // Second fallback to orchestrator if General also unavailable
195
- if (!agentExists(agentName)) {
196
- console.warn(`[Astrocode] General agent also unavailable. Falling back to orchestrator.`);
197
- agentName = config.agents?.orchestrator_name || "Astro";
198
- if (!agentExists(agentName)) {
199
- throw new Error(`Critical: No agents available for delegation. Primary: ${resolveAgentName(next.stage_key, config)}, General, Orchestrator: ${agentName}`);
200
- }
201
- }
202
- }
190
+ if (!agentExists(agentName)) {
191
+ console.warn(`[Astrocode] Agent ${agentName} not found in config. Falling back to orchestrator instead of General.`);
192
+ console.warn(`[Astrocode] Agent check: config.agent exists: ${!!systemConfig.agent}, agentName in config: ${systemConfig.agent ? agentName in systemConfig.agent : 'N/A'}`);
193
+ // Skip General fallback for stage agents to avoid malformed output
194
+ agentName = config.agents?.orchestrator_name || "Astro";
195
+ if (!agentExists(agentName)) {
196
+ throw new Error(`Critical: No agents available for delegation. Primary: ${resolveAgentName(next.stage_key, config)}, Orchestrator: ${agentName}`);
197
+ }
198
+ }
203
199
 
204
200
  console.log(`[Astrocode] Delegating stage ${next.stage_key} to agent: ${agentName}`);
205
201