@evident-ai/cli 3.0.1-dev.4b2470a → 3.0.1-dev.508877b
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/dist/index.js +18 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -470,6 +470,12 @@ import chalk6 from "chalk";
|
|
|
470
470
|
import ora3 from "ora";
|
|
471
471
|
import { select as select3 } from "@inquirer/prompts";
|
|
472
472
|
|
|
473
|
+
// ../../packages/types/src/opencode/index.ts
|
|
474
|
+
function opencodeMessageIdFor(queuedMessageId) {
|
|
475
|
+
const sanitized = queuedMessageId.replace(/[^a-zA-Z0-9]/g, "_");
|
|
476
|
+
return `msg_${sanitized}`;
|
|
477
|
+
}
|
|
478
|
+
|
|
473
479
|
// ../../packages/types/src/telemetry/index.ts
|
|
474
480
|
var TelemetryEventTypes = {
|
|
475
481
|
// Agent activity events (shown in web UI activity log)
|
|
@@ -1114,9 +1120,8 @@ function messageRunState(messages, userMessageId) {
|
|
|
1114
1120
|
if (finishOf(reply) === "tool-calls") return "running";
|
|
1115
1121
|
return "done";
|
|
1116
1122
|
}
|
|
1117
|
-
function
|
|
1118
|
-
|
|
1119
|
-
return `msg_${sanitized}`;
|
|
1123
|
+
function opencodeMessageIdFor2(queuedMessageId) {
|
|
1124
|
+
return opencodeMessageIdFor(queuedMessageId);
|
|
1120
1125
|
}
|
|
1121
1126
|
|
|
1122
1127
|
// src/lib/tunnel/connection.ts
|
|
@@ -1669,11 +1674,13 @@ var ChannelDriver = class {
|
|
|
1669
1674
|
const sessionId = await this.ensureSession(conv);
|
|
1670
1675
|
const messages = await this.getPendingMessages(conv.id);
|
|
1671
1676
|
let dispatched = 0;
|
|
1677
|
+
let skippedAlreadyDispatched = 0;
|
|
1672
1678
|
for (const message of messages) {
|
|
1673
1679
|
if (this.dispatched.has(message.id)) {
|
|
1680
|
+
skippedAlreadyDispatched += 1;
|
|
1674
1681
|
continue;
|
|
1675
1682
|
}
|
|
1676
|
-
const opencodeMessageId =
|
|
1683
|
+
const opencodeMessageId = opencodeMessageIdFor2(message.id);
|
|
1677
1684
|
const options = {
|
|
1678
1685
|
agent: message.opencode_agent ?? void 0,
|
|
1679
1686
|
model: message.opencode_model ?? void 0
|
|
@@ -1703,6 +1710,13 @@ var ChannelDriver = class {
|
|
|
1703
1710
|
this.registerInFlight(conv, sessionId, message, opencodeMessageId);
|
|
1704
1711
|
dispatched += 1;
|
|
1705
1712
|
}
|
|
1713
|
+
if (messages.length > 0 && dispatched === 0 && skippedAlreadyDispatched === messages.length) {
|
|
1714
|
+
this.log({
|
|
1715
|
+
level: "error",
|
|
1716
|
+
message: `Conversation ${conv.id.slice(0, 8)} has ${messages.length} pending message(s) but ALL are already marked dispatched locally (in-flight set: ${this.dispatched.size}) \u2014 none sent to OpenCode this tick. If this repeats, a message may be stuck acknowledged-but-never-dispatched (its watcher never settled).`,
|
|
1717
|
+
conversation_id: conv.id
|
|
1718
|
+
});
|
|
1719
|
+
}
|
|
1706
1720
|
this.ensureWatcherRunning(sessionId);
|
|
1707
1721
|
return dispatched;
|
|
1708
1722
|
}
|