@delegoapp/runner 0.5.4 → 0.6.0

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.
@@ -2,7 +2,7 @@ import { promptThinkingInstruction } from '../thinking.js';
2
2
  export function promptForJob(job) {
3
3
  const thinkingInstruction = promptThinkingInstruction(job.executionPreferences.thinking);
4
4
  const pullRequestInstruction = job.publishingPolicy.autoCreatePr
5
- ? 'Do NOT create a pull request yourself (do not run `gh pr create` or any equivalent). The runner will commit your changes and open the pull request automatically once you exit.'
5
+ ? 'Do NOT create a pull request yourself (do not run `gh pr create` or any equivalent), and do NOT create or switch git branches (no `git checkout -b`, no `git switch -c`). Leave your work on the branch that is already checked out. The runner will commit your changes and open the pull request automatically once you exit.'
6
6
  : `If you create a pull request, start the PR title with: ${job.linearIssue.identifier}:`;
7
7
  return [
8
8
  // This directive must come first — before task content — so Claude enters
@@ -53,7 +53,17 @@ export async function publishBranchAndMaybePr(repositoryPath, job, branchName, c
53
53
  if (!job.publishingPolicy.autoPush) {
54
54
  return null;
55
55
  }
56
- const push = await runCommand('git', ['push', '-u', 'origin', branchName], repositoryPath);
56
+ // Push the current HEAD to the runner's branch ref explicitly, rather than
57
+ // pushing `branchName` by name. An executor that ignores the "do not create
58
+ // branches" instruction may `git checkout -b` and commit its work on a
59
+ // different branch; HEAD then advances (so the pipeline sees new commits and
60
+ // reaches publishing) while the runner's named branch still points at the
61
+ // starting SHA. Pushing `branchName` by name would then upload a commitless
62
+ // branch and `gh pr create` fails with "No commits between main and <branch>".
63
+ // `HEAD:refs/heads/<branchName>` always carries the actual work onto the
64
+ // runner's branch; when HEAD already is `branchName` it behaves identically
65
+ // to pushing the branch by name.
66
+ const push = await runCommand('git', ['push', '-u', 'origin', `HEAD:refs/heads/${branchName}`], repositoryPath);
57
67
  if (push.code !== 0) {
58
68
  throw new Error(`Unable to push branch ${branchName}: ${push.stderr || push.stdout || 'unknown git error'}`);
59
69
  }
@@ -179,6 +179,11 @@ export async function runRealExecutionOnce(config, externalSignal) {
179
179
  prMetadata,
180
180
  publishingPolicy: job.publishingPolicy,
181
181
  pushed,
182
+ // Conversational mode: surface the Claude session id (and the worktree
183
+ // it ran in) on the terminal report so the relay can persist a resume
184
+ // point. A follow-up prompt in the Linear agent session then re-claims
185
+ // this same job/runner and resumes the conversation via `--resume`.
186
+ sessionId: result.sessionId,
182
187
  assistantResponse: result.finalReply,
183
188
  stdoutTail: result.stdout,
184
189
  stderrTail: result.stderr,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@delegoapp/runner",
3
- "version": "0.5.4",
3
+ "version": "0.6.0",
4
4
  "private": false,
5
5
  "description": "Delego runner — polls the Delego relay and executes Linear-delegated coding jobs via Codex CLI or Claude Code.",
6
6
  "keywords": [
@@ -40,7 +40,7 @@
40
40
  },
41
41
  "devDependencies": {
42
42
  "typescript": "^6.0.3",
43
- "vitest": "^4.1.5",
43
+ "vitest": "^4.1.7",
44
44
  "@kit/tsconfig": "0.1.0"
45
45
  },
46
46
  "engines": {