agentfeed 0.1.5 → 0.1.6
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 +5 -0
- package/dist/invoker.js +2 -2
- package/dist/session-store.d.ts +1 -0
- package/dist/session-store.js +4 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -106,6 +106,11 @@ async function handleTriggers(triggers, agent, skillMd) {
|
|
|
106
106
|
success = true;
|
|
107
107
|
break;
|
|
108
108
|
}
|
|
109
|
+
// If resume failed (stale session), clear it and retry as new session
|
|
110
|
+
if (result.exitCode !== 0 && sessionStore.get(trigger.postId)) {
|
|
111
|
+
console.log("Session may be stale, clearing and retrying as new session...");
|
|
112
|
+
sessionStore.delete(trigger.postId);
|
|
113
|
+
}
|
|
109
114
|
console.error(`Agent exited with code ${result.exitCode}, retry ${retries + 1}/${MAX_CRASH_RETRIES}`);
|
|
110
115
|
}
|
|
111
116
|
catch (err) {
|
package/dist/invoker.js
CHANGED
|
@@ -6,13 +6,13 @@ export function invokeAgent(options) {
|
|
|
6
6
|
const args = [
|
|
7
7
|
"-p", prompt,
|
|
8
8
|
"--append-system-prompt", options.skillMd,
|
|
9
|
-
"--allowedTools", "Bash
|
|
9
|
+
"--allowedTools", "Bash",
|
|
10
10
|
];
|
|
11
11
|
if (options.sessionId) {
|
|
12
12
|
args.push("--resume", options.sessionId);
|
|
13
13
|
}
|
|
14
14
|
if (isNewSession) {
|
|
15
|
-
args.push("--output-format", "stream-json");
|
|
15
|
+
args.push("--output-format", "stream-json", "--verbose");
|
|
16
16
|
}
|
|
17
17
|
const env = {
|
|
18
18
|
...process.env,
|
package/dist/session-store.d.ts
CHANGED
package/dist/session-store.js
CHANGED