ework-daemon 0.4.59 → 0.4.60

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/opencode.ts +4 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ework-daemon",
3
- "version": "0.4.59",
3
+ "version": "0.4.60",
4
4
  "description": "Issue-driven AI development daemon. Spawns opencode subprocesses to resolve Gitea issues.",
5
5
  "module": "src/index.ts",
6
6
  "type": "module",
package/src/opencode.ts CHANGED
@@ -393,13 +393,16 @@ export class Engine {
393
393
  // An existing session must keep the backend that owns it: opencode session
394
394
  // ids are "ses_..." while pi ids are bare uuids, so the prefix outvotes the
395
395
  // per-issue override. New sessions follow the issue's runtime setting.
396
+ // k is the session key "tracker:scope#issue@sessionName"; the runtime map is
397
+ // keyed by the issue part, so strip the "@sessionName" suffix.
396
398
  private backendFor(k: string, opencodeSessionId?: string): RuntimeBackend {
399
+ const issueKey = k.slice(0, k.lastIndexOf("@"));
397
400
  if (opencodeSessionId) {
398
401
  const wants = opencodeSessionId.startsWith("ses_") ? "opencode" : "pi";
399
402
  if (wants !== this.cfg.runtime) return this.altBackendFor(wants);
400
403
  return this.backend;
401
404
  }
402
- const runtime = this.issueRuntimes.get(k);
405
+ const runtime = this.issueRuntimes.get(issueKey);
403
406
  if (!runtime || runtime === this.cfg.runtime) return this.backend;
404
407
  return this.altBackendFor(runtime);
405
408
  }