cc2im 0.2.3 → 0.2.4

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/README.md CHANGED
@@ -117,6 +117,10 @@ cc2im 为**单用户场景**设计(一个人通过微信控制自己的多个
117
117
 
118
118
  ## 更新日志
119
119
 
120
+ ### v0.2.4 (2026-04-21)
121
+
122
+ - **fix**: 新注册的 agent 没有历史 session 时,`claude --continue` 立即 exit 1,之前会连续 5 次重启失败被标记阵亡;现在检测到快速非零退出会在下次重启时自动跳过 `--continue` 用新会话启动
123
+
120
124
  ### v0.2.3 (2026-04-20)
121
125
 
122
126
  - **feat**: 启动 CC 实例时默认注入 `--permission-mode auto --allowedTools '*' --effort max`,让 agent 在微信场景下自主执行不卡权限审批。per-agent `claudeArgs`(`~/.cc2im/agents.json`)仍可按 flag 名覆盖
@@ -220,6 +220,7 @@ export class AgentManager {
220
220
  }, CONNECT_TIMEOUT_MS);
221
221
  child.on('exit', (code) => {
222
222
  clearTimeout(connectTimer);
223
+ const wasConnected = this.getConnectedAgents().includes(name);
223
224
  console.log(`[agent-manager] Agent "${name}" exited (code ${code})`);
224
225
  this.processes.delete(name);
225
226
  this.savePgids();
@@ -235,6 +236,12 @@ export class AgentManager {
235
236
  const agentConfig = this.config.agents[name];
236
237
  if (!agentConfig?.autoStart)
237
238
  return;
239
+ // If CC exited fast with non-zero code before ever connecting, --continue probably failed
240
+ // (no prior session for a new agent). Skip --continue on next restart to start fresh.
241
+ if (!wasConnected && code !== 0 && code !== null && !skipContinue) {
242
+ console.log(`[agent-manager] "${name}" exited before connecting — will skip --continue on next restart`);
243
+ this.skipContinueOnce.add(name);
244
+ }
238
245
  // Backoff: track consecutive restarts within time window
239
246
  const now = Date.now();
240
247
  const attempts = this.restartAttempts.get(name);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc2im",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "IM gateway for multiple local Claude Code instances",
5
5
  "author": "roxorlt",
6
6
  "license": "MIT",