@kody-ade/kody-engine 0.2.21 → 0.2.26

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.
@@ -60,6 +60,9 @@
60
60
  {
61
61
  "script": "parseAgentResult"
62
62
  },
63
+ {
64
+ "script": "requireFeedbackActions"
65
+ },
63
66
  {
64
67
  "script": "verify"
65
68
  },
@@ -17,22 +17,29 @@ You are Kody, an autonomous engineer. Apply the feedback below to the existing P
17
17
  ```
18
18
 
19
19
  # Required steps
20
- 1. Read the feedback carefully. It takes precedence over the original issue spec. If feedback says "remove X", remove X even if the issue asked for it.
21
- 2. Research ONLY what's needed to address the feedback. Make the minimum edits required.
22
- 3. Run each quality command with Bash. Fix the root cause of any failure you introduced by this round of edits.
23
- 4. Final message format (or a single `FAILED: <reason>` line on failure):
20
+ 1. **Extract** every actionable item from the feedback. A structured review uses headings like `### Concerns`, `### Suggestions`, and `### Bugs`; each bullet under those headings is a distinct item. `### Strengths`, `### Summary`, and `### Bottom line` are NOT items — skip them. If the feedback has no headings (plain inline feedback), treat the whole feedback as one item.
21
+ 2. **Number each item** internally (Item 1, Item 2, …). You will account for every one of them in your final message below.
22
+ 3. **Research** read only what's needed to act on the items. Make the minimum edits required to implement each one.
23
+ 4. **Verify** run each quality command with Bash. Fix the root cause of any failure you introduced by this round of edits.
24
+ 5. Your FINAL message MUST use this exact format (or a single `FAILED: <reason>` line on failure). The `FEEDBACK_ACTIONS:` block is REQUIRED — omitting it or leaving it empty makes your DONE invalid.
24
25
 
25
26
  ```
26
27
  DONE
28
+ FEEDBACK_ACTIONS:
29
+ - Item 1: "<short restatement of the item>" — <fixed: <what you edited> | declined: <specific reason>>
30
+ - Item 2: "<short restatement>" — <fixed: ... | declined: ...>
31
+ - (one line per extracted item; do NOT omit any)
27
32
  COMMIT_MSG: <conventional-commit message for this round of fixes>
28
33
  PR_SUMMARY:
29
34
  <2-4 bullets describing what changed in THIS fix round — not the whole PR>
30
35
  ```
31
36
 
32
37
  # Rules
33
- - **Treat the feedback as a concrete change request, not a code review to argue with.** If feedback says "add an X branch", you must add an X branch — not document that the existing Y branch already covers the case. "Already handles it in a different way" is NOT an acceptable reason to skip an edit.
34
- - **Your DONE is only valid if your edits produce a diff that materially implements the requested change.** A diff that only adds tests asserting the *current* behavior, or only tweaks comments/docs, does NOT count as addressing a change request. If the feedback asks for a new code path, the diff MUST contain that new code path.
35
- - **"Already satisfied" is only allowed when the code already does exactly what the feedback asks for, verifiable by reading the implementation.** If in doubt, make the edit.
38
+ - **The feedback is the scope.** You are here to address the extracted items nothing else. Do NOT make unrelated refactors, rename variables the reviewer did not flag, or "tighten" types that were not called out. Every edit in your diff must trace back to a specific Item in `FEEDBACK_ACTIONS`.
39
+ - **Default to `fixed`.** `declined` is only acceptable when (a) the item is factually wrong about the code, or (b) it is explicitly out of scope per the issue body. In both cases the `declined: <reason>` line must point to concrete evidence (a file:line that contradicts the item, or a specific issue-body clause).
40
+ - **Treat each item as a concrete change request, not a code review to argue with.** "Add an X branch" means add an X branch — not document that Y already covers the case. "Already handles it in a different way" is NOT an acceptable reason to decline.
41
+ - **Your DONE is only valid if your diff materially implements each `fixed` item.** A diff that only adds tests asserting the current behavior, or only tweaks comments/docs, does NOT count as addressing a change request. If an item asks for a new code path, the diff MUST contain that new code path.
42
+ - **"Already satisfied" (i.e. skipping the edit because the code already does what's asked) is only allowed when you can cite the exact file:line that already implements it.** If in doubt, make the edit — under `fixed`.
36
43
  - Do NOT run git/gh commands. The wrapper handles it.
37
44
  - Stay on `{{branch}}`.
38
45
  - Do not modify files under `.kody/`, `.kody-engine/`, `.kody2/`, `node_modules/`, `dist/`, `build/`, `.env`, `*.log`.
@@ -51,6 +51,9 @@
51
51
  {
52
52
  "script": "persistArtifacts"
53
53
  },
54
+ {
55
+ "script": "postPlanComment"
56
+ },
54
57
  {
55
58
  "script": "writeRunSummary"
56
59
  },
@@ -87,6 +87,8 @@ export interface ClaudeCodeSpec {
87
87
  permissionMode: "default" | "acceptEdits" | "plan" | "bypassPermissions"
88
88
  /** null = unbounded. */
89
89
  maxTurns: number | null
90
+ /** Extended-thinking token budget. null = SDK default. */
91
+ maxThinkingTokens: number | null
90
92
  /** Text appended on top of Claude Code's baseline system prompt. */
91
93
  systemPromptAppend: string | null
92
94
  /** SDK built-in tools this executable is allowed to use (capability pack). */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.2.21",
3
+ "version": "0.2.26",
4
4
  "description": "kody2 — autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative executable profiles.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -12,6 +12,18 @@
12
12
  "templates",
13
13
  "kody.config.schema.json"
14
14
  ],
15
+ "scripts": {
16
+ "kody2": "tsx bin/kody2.ts",
17
+ "build": "tsup && node scripts/copy-assets.cjs",
18
+ "test": "vitest run tests/unit tests/int --no-coverage",
19
+ "test:e2e": "vitest run tests/e2e --no-coverage",
20
+ "test:all": "vitest run tests --no-coverage",
21
+ "typecheck": "tsc --noEmit",
22
+ "lint": "biome check",
23
+ "lint:fix": "biome check --write",
24
+ "format": "biome format --write",
25
+ "prepublishOnly": "pnpm build"
26
+ },
15
27
  "dependencies": {
16
28
  "@anthropic-ai/claude-agent-sdk": "0.2.92"
17
29
  },
@@ -31,16 +43,5 @@
31
43
  "url": "git+https://github.com/aharonyaircohen/kody-engine.git"
32
44
  },
33
45
  "homepage": "https://github.com/aharonyaircohen/kody-engine",
34
- "bugs": "https://github.com/aharonyaircohen/kody-engine/issues",
35
- "scripts": {
36
- "kody2": "tsx bin/kody2.ts",
37
- "build": "tsup && node scripts/copy-assets.cjs",
38
- "test": "vitest run tests/unit tests/int --no-coverage",
39
- "test:e2e": "vitest run tests/e2e --no-coverage",
40
- "test:all": "vitest run tests --no-coverage",
41
- "typecheck": "tsc --noEmit",
42
- "lint": "biome check",
43
- "lint:fix": "biome check --write",
44
- "format": "biome format --write"
45
- }
46
- }
46
+ "bugs": "https://github.com/aharonyaircohen/kody-engine/issues"
47
+ }
@@ -1,9 +1,13 @@
1
1
  # Drop this file at .github/workflows/kody2.yml in your repo.
2
2
  #
3
- # Triggers: @kody2 comment on an issue or PR, or manual workflow_dispatch.
4
- # Everything else (install deps, set up LiteLLM, run the agent, open the PR)
5
- # is handled inside the @kody-ade/kody-engine package. This template should
6
- # rarely need editing — future kody2 capabilities ship via npm publish.
3
+ # Two triggers, two modes:
4
+ # - issue_comment / workflow_dispatch with issue_number `kody2 ci`
5
+ # (the @kody2 issue/PR automation flow)
6
+ # - workflow_dispatch with sessionId → `kody2 chat`
7
+ # (dashboard-driven Gemini chat session)
8
+ #
9
+ # All orchestration lives in the kody2 npm package; future capabilities ship
10
+ # via `npm publish`, not by editing this file.
7
11
  #
8
12
  # Required repo secrets: at least one model provider key (e.g. MINIMAX_API_KEY,
9
13
  # ANTHROPIC_API_KEY). kody2 reads any *_API_KEY secret automatically via
@@ -12,10 +16,8 @@
12
16
  # Recommended: KODY_TOKEN secret — a fine-grained PAT or GitHub App token
13
17
  # with `repo` + `read:org` scopes. Without it, kody2's commits/PR-creation
14
18
  # still work via github.token, but two things degrade:
15
- # 1. PR body updates fail with "token lacks read:org scope" (cosmetic,
16
- # surfaces as warnings in logs; the PR itself is still created/updated).
17
- # 2. Pushes from kody2 won't trigger downstream workflows (github.token
18
- # pushes are deliberately blocked from re-triggering CI).
19
+ # 1. PR body updates fail with "token lacks read:org scope" (cosmetic).
20
+ # 2. Pushes from kody2 won't trigger downstream workflows.
19
21
  # Set KODY_TOKEN in repo Settings → Secrets → Actions.
20
22
 
21
23
  name: kody2
@@ -24,16 +26,30 @@ on:
24
26
  workflow_dispatch:
25
27
  inputs:
26
28
  issue_number:
27
- description: "GitHub issue number"
28
- required: true
29
+ description: "GitHub issue number (agent mode)"
30
+ type: string
31
+ default: ""
32
+ sessionId:
33
+ description: "Chat session ID (chat mode, from Kody-Dashboard)"
34
+ type: string
35
+ default: ""
36
+ message:
37
+ description: "Initial chat message (optional)"
29
38
  type: string
39
+ default: ""
40
+ model:
41
+ description: "Model override (optional, e.g. anthropic/claude-haiku-4-5-20251001)"
42
+ type: string
43
+ default: ""
44
+ dashboardUrl:
45
+ description: "Dashboard event ingest URL with inline ?token=... (chat mode)"
46
+ type: string
47
+ default: ""
30
48
  issue_comment:
31
49
  types: [created]
32
50
 
33
51
  jobs:
34
52
  run:
35
- # Skip bot-authored comments (e.g. kody2-bot's own status posts) so we
36
- # don't loop the workflow on our own output.
37
53
  if: >-
38
54
  ${{ github.event_name == 'workflow_dispatch' ||
39
55
  (github.event_name == 'issue_comment' &&
@@ -41,7 +57,10 @@ jobs:
41
57
  github.event.comment.user.login != 'kody2-bot' &&
42
58
  github.event.comment.user.type != 'Bot') }}
43
59
  runs-on: ubuntu-latest
44
- timeout-minutes: 60
60
+ timeout-minutes: 360
61
+ concurrency:
62
+ group: kody2-${{ inputs.sessionId || inputs.issue_number || github.event.issue.number || github.sha }}
63
+ cancel-in-progress: false
45
64
  permissions:
46
65
  issues: write
47
66
  pull-requests: write
@@ -56,10 +75,24 @@ jobs:
56
75
  with:
57
76
  node-version: 22
58
77
 
78
+ - name: Write pip cache key for LiteLLM
79
+ run: echo "litellm[proxy]" > "$RUNNER_TEMP/kody2-pip-requirements.txt"
80
+
59
81
  - uses: actions/setup-python@v5
60
82
  with:
61
83
  python-version: "3.12"
84
+ cache: "pip"
85
+ cache-dependency-path: ${{ runner.temp }}/kody2-pip-requirements.txt
62
86
 
63
87
  - env:
64
- ALL_SECRETS: ${{ toJSON(secrets) }}
65
- run: npx -y -p @kody-ade/kody-engine@latest kody2 ci
88
+ ALL_SECRETS: ${{ toJSON(secrets) }}
89
+ SESSION_ID: ${{ inputs.sessionId }}
90
+ INIT_MESSAGE: ${{ inputs.message }}
91
+ MODEL: ${{ inputs.model }}
92
+ DASHBOARD_URL: ${{ inputs.dashboardUrl }}
93
+ run: |
94
+ if [ -n "$SESSION_ID" ]; then
95
+ npx -y -p @kody-ade/kody-engine@latest kody2 chat
96
+ else
97
+ npx -y -p @kody-ade/kody-engine@latest kody2 ci
98
+ fi