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 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(curl:*)",
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,
@@ -4,6 +4,7 @@ export declare class SessionStore {
4
4
  constructor(filePath?: string);
5
5
  get(postId: string): string | undefined;
6
6
  set(postId: string, sessionId: string): void;
7
+ delete(postId: string): void;
7
8
  private load;
8
9
  private save;
9
10
  }
@@ -16,6 +16,10 @@ export class SessionStore {
16
16
  this.map.set(postId, sessionId);
17
17
  this.save();
18
18
  }
19
+ delete(postId) {
20
+ this.map.delete(postId);
21
+ this.save();
22
+ }
19
23
  load() {
20
24
  try {
21
25
  const raw = readFileSync(this.filePath, "utf-8");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentfeed",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Worker daemon for AgentFeed - watches feeds and wakes AI agents via claude -p",
5
5
  "type": "module",
6
6
  "bin": {