@link-assistant/hive-mind 1.48.0 → 1.48.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @link-assistant/hive-mind
2
2
 
3
+ ## 1.48.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 7c3a8c1: Fix agent queue not isolated from claude queue in bot entry point. The start decision and position display now use tool-specific queue counts instead of the total across all tools, so items in one tool's queue don't block or mislead the other.
8
+
9
+ ## 1.48.1
10
+
11
+ ### Patch Changes
12
+
13
+ - 6d385ab: Simplified cost display when public and Anthropic costs match, removed USD suffix from Anthropic cost line
14
+
3
15
  ## 1.48.0
4
16
 
5
17
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@link-assistant/hive-mind",
3
- "version": "1.48.0",
3
+ "version": "1.48.2",
4
4
  "description": "AI-powered issue solver and hive mind for collaborative problem solving",
5
5
  "main": "src/hive.mjs",
6
6
  "type": "module",
@@ -118,15 +118,23 @@ export const displayModelUsage = async (usage, log) => {
118
118
 
119
119
  /**
120
120
  * Display cost comparison between public pricing and Anthropic's official cost
121
+ * Issue #1557: Show simplified format when costs match, remove USD suffix
121
122
  * @param {number|null} publicCost - Public pricing estimate
122
123
  * @param {number|null} anthropicCost - Anthropic's official cost
123
124
  * @param {Function} log - Logging function
124
125
  */
125
126
  export const displayCostComparison = async (publicCost, anthropicCost, log) => {
127
+ const hasPublic = publicCost !== null && publicCost !== undefined;
128
+ const hasAnthropic = anthropicCost !== null && anthropicCost !== undefined;
129
+ // Issue #1557: When both costs match, show simplified format
130
+ if (hasPublic && hasAnthropic && publicCost.toFixed(6) === anthropicCost.toFixed(6)) {
131
+ await log(`\n šŸ’° Cost: $${anthropicCost.toFixed(6)}`);
132
+ return;
133
+ }
126
134
  await log('\n šŸ’° Cost estimation:');
127
- await log(` Public pricing estimate: ${publicCost !== null && publicCost !== undefined ? `$${publicCost.toFixed(6)} USD` : 'unknown'}`);
128
- await log(` Calculated by Anthropic: ${anthropicCost !== null && anthropicCost !== undefined ? `$${anthropicCost.toFixed(6)} USD` : 'unknown'}`);
129
- if (publicCost !== null && publicCost !== undefined && anthropicCost !== null && anthropicCost !== undefined) {
135
+ await log(` Public pricing estimate: ${hasPublic ? `$${publicCost.toFixed(6)}` : 'unknown'}`);
136
+ await log(` Calculated by Anthropic: ${hasAnthropic ? `$${anthropicCost.toFixed(6)}` : 'unknown'}`);
137
+ if (hasPublic && hasAnthropic) {
130
138
  const difference = anthropicCost - publicCost;
131
139
  const percentDiff = publicCost > 0 ? (difference / publicCost) * 100 : 0;
132
140
  await log(` Difference: $${difference.toFixed(6)} (${percentDiff > 0 ? '+' : ''}${percentDiff.toFixed(2)}%)`);
@@ -15,13 +15,15 @@ import { getToolDisplayName, getModelInfoForComment } from './models/index.mjs';
15
15
  export { getToolDisplayName }; // Re-export for use by other modules
16
16
  import { buildBudgetStatsString } from './claude.budget-stats.lib.mjs';
17
17
 
18
- /** Build cost estimation string for log comments (Issue #1250) */
18
+ /** Build cost estimation string for log comments (Issue #1250, Issue #1557) */
19
19
  const buildCostInfoString = (totalCostUSD, anthropicTotalCostUSD, pricingInfo) => {
20
20
  const hasPublic = totalCostUSD !== null && totalCostUSD !== undefined;
21
21
  const hasAnthropic = anthropicTotalCostUSD !== null && anthropicTotalCostUSD !== undefined;
22
22
  const hasPricing = pricingInfo && (pricingInfo.modelName || pricingInfo.tokenUsage || pricingInfo.isFreeModel || pricingInfo.isOpencodeFreeModel);
23
23
  const hasOpencodeCost = pricingInfo?.opencodeCost !== null && pricingInfo?.opencodeCost !== undefined;
24
24
  if (!hasPublic && !hasAnthropic && !hasPricing && !hasOpencodeCost) return '';
25
+ // Issue #1557: Simplified display when public and Anthropic costs match
26
+ if (hasPublic && hasAnthropic && totalCostUSD.toFixed(6) === anthropicTotalCostUSD.toFixed(6)) return `\n\n### šŸ’° Cost: **$${anthropicTotalCostUSD.toFixed(6)}**`;
25
27
  let costInfo = '\n\n### šŸ’° **Cost estimation:**';
26
28
  if (pricingInfo?.modelName) {
27
29
  costInfo += `\n- Model: ${pricingInfo.modelName}`;
@@ -57,7 +59,7 @@ const buildCostInfoString = (totalCostUSD, anthropicTotalCostUSD, pricingInfo) =
57
59
  costInfo += tokenInfo;
58
60
  }
59
61
  if (hasAnthropic) {
60
- costInfo += `\n- Calculated by Anthropic: $${anthropicTotalCostUSD.toFixed(6)} USD`;
62
+ costInfo += `\n- Calculated by Anthropic: $${anthropicTotalCostUSD.toFixed(6)}`;
61
63
  if (hasPublic) {
62
64
  const diff = anthropicTotalCostUSD - totalCostUSD;
63
65
  const pct = totalCostUSD > 0 ? (diff / totalCostUSD) * 100 : 0;
@@ -66,12 +68,8 @@ const buildCostInfoString = (totalCostUSD, anthropicTotalCostUSD, pricingInfo) =
66
68
  }
67
69
  return costInfo;
68
70
  };
69
-
70
- // Helper function to mask GitHub tokens (alias for backward compatibility)
71
- export const maskGitHubToken = maskToken;
72
- // Escape ``` in logs for safe markdown embedding (replaces with \`\`\` to prevent code block closure)
73
- export const escapeCodeBlocksInLog = logContent => logContent.replace(/```/g, '\\`\\`\\`');
74
- // Helper function to check if a file exists in a GitHub branch
71
+ export const maskGitHubToken = maskToken; // Alias for backward compatibility
72
+ export const escapeCodeBlocksInLog = logContent => logContent.replace(/```/g, '\\`\\`\\`'); // Escape ``` in logs
75
73
  export const checkFileInBranch = async (owner, repo, fileName, branchName) => {
76
74
  const { $ } = await use('command-stream');
77
75
 
@@ -1025,12 +1025,13 @@ async function handleSolveCommand(ctx) {
1025
1025
  return;
1026
1026
  }
1027
1027
 
1028
- if (check.canStart && queueStats.queued === 0) {
1028
+ const toolQueuedCount = queueStats.queuedByTool[solveTool] || 0; // tool-specific queue count (#1551)
1029
+ if (check.canStart && toolQueuedCount === 0) {
1029
1030
  const startingMessage = await safeReply(ctx, `šŸš€ Starting solve command...\n\n${infoBlock}`, { reply_to_message_id: ctx.message.message_id });
1030
1031
  await executeAndUpdateMessage(ctx, startingMessage, 'solve', args, infoBlock, solvePerCommandIsolation);
1031
1032
  } else {
1032
1033
  const queueItem = solveQueue.enqueue({ url: normalizedUrl, args, ctx, requester, infoBlock, tool: solveTool, perCommandIsolation: solvePerCommandIsolation });
1033
- let queueMessage = `šŸ“‹ Solve command queued (position #${queueStats.queued + 1})\n\n${infoBlock}`;
1034
+ let queueMessage = `šŸ“‹ Solve command queued (${solveTool} queue position #${toolQueuedCount + 1})\n\n${infoBlock}`; // tool-specific position (#1551)
1034
1035
  if (check.reason) queueMessage += `\n\nā³ Waiting: ${escapeMarkdown(check.reason)}`;
1035
1036
  const queuedMessage = await safeReply(ctx, queueMessage, { reply_to_message_id: ctx.message.message_id });
1036
1037
  queueItem.messageInfo = { chatId: queuedMessage.chat.id, messageId: queuedMessage.message_id };