lcode-cli 0.59.0__tar.gz → 0.61.0__tar.gz

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 (264) hide show
  1. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/.github/PULL_REQUEST_TEMPLATE.md +1 -1
  2. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/.github/workflows/ci.yml +5 -3
  3. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/.github/workflows/docs.yml +1 -1
  4. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/.github/workflows/release.yml +1 -1
  5. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/AGENTS.md +1 -0
  6. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/CHANGELOG.md +72 -1
  7. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/CONTRIBUTING.md +2 -1
  8. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/PKG-INFO +1 -1
  9. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/docs/how-it-works.md +22 -12
  10. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/docs/installation.md +1 -0
  11. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/docs/models.md +19 -0
  12. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/docs/public-benchmarks.md +11 -1
  13. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/docs/quickstart.md +1 -1
  14. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/docs/traces.md +3 -1
  15. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/docs/troubleshooting.md +33 -0
  16. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/docs/usage.md +29 -4
  17. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/pyproject.toml +13 -1
  18. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/__init__.py +1 -1
  19. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/acp.py +22 -2
  20. lcode_cli-0.61.0/src/lcode/agent.py +720 -0
  21. lcode_cli-0.61.0/src/lcode/agent_base.py +212 -0
  22. lcode_cli-0.61.0/src/lcode/agent_checks.py +156 -0
  23. lcode_cli-0.61.0/src/lcode/agent_context.py +165 -0
  24. lcode_cli-0.61.0/src/lcode/agent_model.py +343 -0
  25. lcode_cli-0.61.0/src/lcode/agent_prompt.py +304 -0
  26. lcode_cli-0.61.0/src/lcode/agent_sessions.py +157 -0
  27. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/api.py +9 -4
  28. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/assistant.py +2 -1
  29. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/bench.py +3 -671
  30. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/bench_backend.py +1 -1
  31. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/bench_budgets.py +1 -1
  32. lcode_cli-0.61.0/src/lcode/bench_checks.py +61 -0
  33. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/bench_dedupe.py +1 -1
  34. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/bench_flaky.py +2 -2
  35. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/bench_logsum.py +1 -1
  36. lcode_cli-0.61.0/src/lcode/bench_quick.py +650 -0
  37. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/bench_quotes.py +1 -1
  38. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/bench_runtime.py +1 -1
  39. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/catalog.py +11 -1
  40. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/checks.py +74 -2
  41. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/cli.py +22 -491
  42. lcode_cli-0.61.0/src/lcode/cli_args.py +230 -0
  43. lcode_cli-0.61.0/src/lcode/clips.py +68 -0
  44. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/comfy.py +5 -4
  45. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/config.py +1 -1
  46. lcode_cli-0.61.0/src/lcode/doctor.py +280 -0
  47. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/edits.py +3 -2
  48. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/escalate.py +2 -2
  49. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/extensions.py +2 -2
  50. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/film.py +4 -4
  51. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/harbor.py +6 -5
  52. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/harbor_bench.py +100 -9
  53. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/hardware.py +31 -8
  54. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/hooks.py +1 -1
  55. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/imageopts.py +5 -4
  56. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/jobs.py +70 -25
  57. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/lsp.py +6 -5
  58. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/manual.py +5 -4
  59. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/matching.py +2 -2
  60. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/mcp/auth.py +2 -1
  61. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/mcp/catalog.py +4 -3
  62. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/mcp/config.py +9 -7
  63. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/mcp/manager.py +2 -1
  64. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/mcp/server.py +4 -4
  65. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/media.py +6 -394
  66. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/media_catalog.py +1 -1
  67. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/media_cloud.py +2 -2
  68. lcode_cli-0.61.0/src/lcode/media_video.py +377 -0
  69. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/permissions.py +1 -1
  70. lcode_cli-0.61.0/src/lcode/qt_hook.py +317 -0
  71. lcode_cli-0.61.0/src/lcode/repl.py +860 -0
  72. lcode_cli-0.61.0/src/lcode/repl_history.py +297 -0
  73. lcode_cli-0.61.0/src/lcode/repl_media.py +334 -0
  74. lcode_cli-0.61.0/src/lcode/repl_models.py +311 -0
  75. lcode_cli-0.61.0/src/lcode/repl_sessions.py +137 -0
  76. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/replay.py +7 -6
  77. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/residency.py +135 -0
  78. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/review.py +2 -1
  79. lcode_cli-0.61.0/src/lcode/screenshots.py +677 -0
  80. lcode_cli-0.61.0/src/lcode/screenshots_web.py +400 -0
  81. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/servers/encord.py +3 -2
  82. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/servers/valohai.py +1 -1
  83. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/sessions.py +3 -2
  84. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/steer.py +16 -9
  85. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/subagents.py +3 -3
  86. lcode_cli-0.61.0/src/lcode/tool_helpers.py +128 -0
  87. lcode_cli-0.61.0/src/lcode/tool_schemas.py +326 -0
  88. lcode_cli-0.61.0/src/lcode/tools.py +579 -0
  89. lcode_cli-0.61.0/src/lcode/tools_base.py +79 -0
  90. lcode_cli-0.61.0/src/lcode/tools_edit.py +223 -0
  91. lcode_cli-0.61.0/src/lcode/tools_shell.py +278 -0
  92. lcode_cli-0.61.0/src/lcode/trace_export.py +184 -0
  93. lcode_cli-0.61.0/src/lcode/trace_view.py +313 -0
  94. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/traces.py +11 -452
  95. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/conftest.py +1 -0
  96. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_acp.py +39 -11
  97. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_agent.py +1 -1
  98. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_bench.py +6 -6
  99. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_catalog.py +11 -0
  100. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_checks.py +23 -2
  101. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_comfy.py +7 -7
  102. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_context_picker.py +2 -1
  103. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_conversations.py +2 -2
  104. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_gitflow.py +1 -1
  105. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_harbor_bench.py +68 -2
  106. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_jobs.py +145 -2
  107. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_long_clips.py +7 -7
  108. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_look.py +4 -2
  109. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_media_cloud.py +3 -3
  110. lcode_cli-0.61.0/tests/test_residency.py +503 -0
  111. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_sandbox.py +12 -0
  112. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_screenshots.py +21 -18
  113. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_stuck.py +160 -3
  114. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_tools.py +1 -1
  115. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_traces.py +30 -26
  116. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_video.py +2 -2
  117. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/uv.lock +32 -2
  118. lcode_cli-0.59.0/src/lcode/agent.py +0 -1775
  119. lcode_cli-0.59.0/src/lcode/repl.py +0 -1848
  120. lcode_cli-0.59.0/src/lcode/screenshots.py +0 -1362
  121. lcode_cli-0.59.0/src/lcode/tools.py +0 -1454
  122. lcode_cli-0.59.0/tests/test_residency.py +0 -164
  123. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/.editorconfig +0 -0
  124. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/.github/CODEOWNERS +0 -0
  125. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
  126. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  127. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
  128. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/.github/ISSUE_TEMPLATE/model_request.yml +0 -0
  129. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/.github/dependabot.yml +0 -0
  130. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/.gitignore +0 -0
  131. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/.pre-commit-config.yaml +0 -0
  132. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/CODE_OF_CONDUCT.md +0 -0
  133. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/LICENSE +0 -0
  134. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/README.md +0 -0
  135. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/SECURITY.md +0 -0
  136. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/action.yml +0 -0
  137. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/docs/agents.md +0 -0
  138. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/docs/assets/demo.svg +0 -0
  139. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/docs/assets/extra.css +0 -0
  140. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/docs/assets/film-fox-and-kitten.jpg +0 -0
  141. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/docs/assets/long-clip-tulip.jpg +0 -0
  142. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/docs/automation.md +0 -0
  143. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/docs/bench.md +0 -0
  144. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/docs/changelog.md +0 -0
  145. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/docs/commands.md +0 -0
  146. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/docs/configuration.md +0 -0
  147. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/docs/contributing.md +0 -0
  148. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/docs/editors.md +0 -0
  149. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/docs/git.md +0 -0
  150. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/docs/hooks.md +0 -0
  151. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/docs/index.md +0 -0
  152. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/docs/lsp.md +0 -0
  153. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/docs/mcp.md +0 -0
  154. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/docs/memory.md +0 -0
  155. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/docs/modes.md +0 -0
  156. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/docs/sandbox.md +0 -0
  157. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/docs/search.md +0 -0
  158. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/docs/servers.md +0 -0
  159. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/examples/README.md +0 -0
  160. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/examples/api/fix_tests.py +0 -0
  161. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/examples/commands/review.md +0 -0
  162. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/examples/skills/commit-message/SKILL.md +0 -0
  163. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/examples/skills/commit-message/scripts/staged.sh +0 -0
  164. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/install.sh +0 -0
  165. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/mkdocs.yml +0 -0
  166. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/overrides/main.html +0 -0
  167. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/scripts/make_logos.py +0 -0
  168. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/scripts/record_demo.py +0 -0
  169. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/scripts/social-preview.html +0 -0
  170. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/__main__.py +0 -0
  171. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/action.py +0 -0
  172. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/backends.py +0 -0
  173. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/checkpoints.py +0 -0
  174. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/clipboard.py +0 -0
  175. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/cloud.py +0 -0
  176. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/codesearch.py +0 -0
  177. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/context.py +0 -0
  178. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/frontmatter.py +0 -0
  179. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/gitflow.py +0 -0
  180. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/limits.py +0 -0
  181. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/mcp/__init__.py +0 -0
  182. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/mcp/catalog.toml +0 -0
  183. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/mcp/client.py +0 -0
  184. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/mcp/commands.py +0 -0
  185. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/mcp/http.py +0 -0
  186. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/mcp/protocol.py +0 -0
  187. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/mcp/stdio.py +0 -0
  188. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/media.toml +0 -0
  189. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/memory.py +0 -0
  190. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/models.toml +0 -0
  191. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/modes.py +0 -0
  192. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/notify.py +0 -0
  193. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/ollama.py +0 -0
  194. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/planning.py +0 -0
  195. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/preview.py +0 -0
  196. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/render.py +0 -0
  197. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/repeats.py +0 -0
  198. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/repoid.py +0 -0
  199. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/repomap.py +0 -0
  200. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/sandbox.py +0 -0
  201. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/secretscan.py +0 -0
  202. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/servers/__init__.py +0 -0
  203. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/servers/xai.py +0 -0
  204. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/unreachable.py +0 -0
  205. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/update.py +0 -0
  206. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/vision.py +0 -0
  207. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/web.py +0 -0
  208. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/workflows/__init__.py +0 -0
  209. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/workflows/flux2-klein-4b-t2i.json +0 -0
  210. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/workflows/remove-background.json +0 -0
  211. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/workflows/smooth-film.json +0 -0
  212. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/workflows/sound-stable-audio.json +0 -0
  213. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/workflows/upscale-esrgan.json +0 -0
  214. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/workflows/upscale-video-esrgan.json +0 -0
  215. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/workflows/wan21-fun-camera.json +0 -0
  216. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/workflows/wan21-vace.json +0 -0
  217. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/workflows/wan22-fun-inp-5b.json +0 -0
  218. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/workflows/wan22-ti2v-5b.json +0 -0
  219. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/src/lcode/workflows/z-image-turbo-t2i.json +0 -0
  220. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/comfy_standin.py +0 -0
  221. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/fake_lsp_server.py +0 -0
  222. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/fake_mcp_server.py +0 -0
  223. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_action.py +0 -0
  224. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_api.py +0 -0
  225. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_assistant.py +0 -0
  226. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_backends.py +0 -0
  227. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_bench_work.py +0 -0
  228. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_checkpoints.py +0 -0
  229. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_cli.py +0 -0
  230. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_clipboard.py +0 -0
  231. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_cloud.py +0 -0
  232. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_codesearch.py +0 -0
  233. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_config.py +0 -0
  234. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_context.py +0 -0
  235. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_escalate.py +0 -0
  236. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_extensions.py +0 -0
  237. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_film.py +0 -0
  238. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_gpu_handover.py +0 -0
  239. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_hooks.py +0 -0
  240. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_image_edit.py +0 -0
  241. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_image_generate.py +0 -0
  242. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_lsp.py +0 -0
  243. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_manual.py +0 -0
  244. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_matching.py +0 -0
  245. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_mcp.py +0 -0
  246. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_media_catalog.py +0 -0
  247. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_memory.py +0 -0
  248. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_model_picker.py +0 -0
  249. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_modes.py +0 -0
  250. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_permissions.py +0 -0
  251. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_plan_mode.py +0 -0
  252. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_repeats.py +0 -0
  253. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_repomap.py +0 -0
  254. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_review.py +0 -0
  255. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_robustness.py +0 -0
  256. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_secretscan.py +0 -0
  257. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_servers.py +0 -0
  258. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_sessions.py +0 -0
  259. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_steer.py +0 -0
  260. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_subagents.py +0 -0
  261. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_update.py +0 -0
  262. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_vision.py +0 -0
  263. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_web.py +0 -0
  264. {lcode_cli-0.59.0 → lcode_cli-0.61.0}/tests/test_xai.py +0 -0
@@ -8,7 +8,7 @@
8
8
 
9
9
  ## Checklist
10
10
 
11
- - [ ] `uv run pytest` and `uv run ruff check .` pass
11
+ - [ ] `uv run pytest`, `uv run ruff check .` and `uv run basedpyright` pass
12
12
  - [ ] Tests cover the change
13
13
  - [ ] Docs and `CHANGELOG.md` (*Unreleased*) are updated for user-facing changes
14
14
  - [ ] Changes to prompts, tools or context handling: the dev slice before and after is under "How was it tested?" (`lcode bench --compare`)
@@ -18,9 +18,11 @@ jobs:
18
18
  runs-on: ubuntu-latest
19
19
  steps:
20
20
  - uses: actions/checkout@v7
21
- - uses: astral-sh/setup-uv@v10.3.2
21
+ - uses: astral-sh/setup-uv@v10.3.3
22
22
  - run: uv run --group dev ruff check .
23
23
  - run: uv run --group dev ruff format --check .
24
+ - name: Type check
25
+ run: uv run --group dev basedpyright
24
26
  - name: Shellcheck install.sh
25
27
  run: shellcheck install.sh
26
28
 
@@ -34,7 +36,7 @@ jobs:
34
36
  python: ["3.10", "3.11", "3.12", "3.13", "3.14"]
35
37
  steps:
36
38
  - uses: actions/checkout@v7
37
- - uses: astral-sh/setup-uv@v10.3.2
39
+ - uses: astral-sh/setup-uv@v10.3.3
38
40
  with:
39
41
  python-version: ${{ matrix.python }}
40
42
  - run: uv run --group dev pytest
@@ -44,7 +46,7 @@ jobs:
44
46
  runs-on: ubuntu-latest
45
47
  steps:
46
48
  - uses: actions/checkout@v7
47
- - uses: astral-sh/setup-uv@v10.3.2
49
+ - uses: astral-sh/setup-uv@v10.3.3
48
50
  - run: uv build
49
51
  - name: Check the wheel ships the model catalog
50
52
  run: unzip -l dist/*.whl | grep -q "lcode/models.toml"
@@ -19,7 +19,7 @@ jobs:
19
19
  runs-on: ubuntu-latest
20
20
  steps:
21
21
  - uses: actions/checkout@v7
22
- - uses: astral-sh/setup-uv@v10.3.2
22
+ - uses: astral-sh/setup-uv@v10.3.3
23
23
  - run: uv run --group docs mkdocs build --strict
24
24
  - name: Publish the installer next to the site
25
25
  run: cp install.sh site/install.sh
@@ -22,7 +22,7 @@ jobs:
22
22
  id-token: write # to prove to PyPI that the upload comes from this workflow
23
23
  steps:
24
24
  - uses: actions/checkout@v7
25
- - uses: astral-sh/setup-uv@v10.3.2
25
+ - uses: astral-sh/setup-uv@v10.3.3
26
26
  - name: Check the release tag matches the package version
27
27
  run: |
28
28
  version=$(sed -n 's/^__version__ = "\(.*\)"/\1/p' src/lcode/__init__.py)
@@ -14,6 +14,7 @@ packaged with hatchling, managed with uv. Runtime dependencies: requests, rich,
14
14
  uv sync --group dev # set up .venv
15
15
  uv run pytest # tests (no Ollama needed)
16
16
  uv run ruff check . && uv run ruff format --check .
17
+ uv run basedpyright # type check src/lcode
17
18
  uv run --group docs mkdocs build --strict # docs
18
19
  uv run lcode doctor # check a local install against a running Ollama
19
20
  ```
@@ -6,6 +6,75 @@ All notable changes to lcode are documented here. The format follows
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.61.0] - 2026-11-05
10
+
11
+ ### Added
12
+
13
+ - **Code it never ran** (#242). When a request wrote a new code file and no command since its last
14
+ change ran it, lcode sends the model back once, to run it or to say plainly that it's untested. A
15
+ syntax check, a program that isn't installed (`python3: command not found`) or a command that only
16
+ reads doesn't count. With `uv` installed, the note says how to run Python code in a throwaway
17
+ environment. On the dev slice at 32K, 5 of 6 `torch-tensor-parallelism` attempts wrote the module,
18
+ found no `python3` or checked only its syntax, and said they were done: each had a runtime error
19
+ that one run would have shown. A project with checks of its own gets those instead.
20
+ - **lcode says when the machine is short of RAM for the model** (#246). A model that ran well at first
21
+ could fall to about a third of its speed, and nothing said why: the part of the model outside GPU
22
+ memory and Ollama's prompt cache, which grows to 8 GB in a long session, both have to fit in RAM, and
23
+ lcode only compared the model with the machine's total. On Linux, with Ollama on the same machine,
24
+ `lcode doctor` has a `RAM` line that compares them with what's available now and, when they don't
25
+ fit, says what to do: close programs, use a smaller context, or pick a smaller model. `lcode setup`
26
+ gives the same warning on its recommendation, and a session says it once when replies fall below half
27
+ of their earlier speed and RAM is short.
28
+
29
+ ### Changed
30
+
31
+ - **After a reply that goes nowhere** (it went round in circles, filled the context before it said
32
+ anything, or was empty), the model's next reply runs with thinking off (with Ollama), so it acts
33
+ instead of starting the same deliberation over. lcode now stops the request when two replies in a row go
34
+ nowhere, or four in one request, instead of the second one anywhere in it. On the dev slice at 32K,
35
+ 16 of 150 attempts were stopped this way, and all of them failed: 9 because the second chance went
36
+ round in circles again (all 6 `polyglot-rust-c` attempts among them), and 7 that had recovered and
37
+ worked on until another reply went nowhere much later (#241).
38
+
39
+ ### Fixed
40
+
41
+ - **A service you ask lcode to leave running stays up after lcode exits** (#240). lcode stopped every
42
+ background job when the session ended, and there was no way to keep one: on the dev slice, 5 of 6
43
+ `pypi-server` attempts failed because the server the task asked for was gone when its tests ran. The
44
+ model now starts such a service with `keep=true`. It writes its output to a log in
45
+ `~/.local/state/lcode/jobs/` instead of to lcode, so it keeps running, and lcode says how to stop it.
46
+ It always asks first, and the question says that the command stays running.
47
+ - **A background command written with `&`** (`server &`) looked as if it had ended right away, while the
48
+ program kept running where lcode couldn't see or stop it, and held its port. The `&` is now ignored, and
49
+ the program is a background job like any other. What a background command otherwise leaves behind
50
+ when it ends at once (`server & echo started`) is stopped, and the model hears why (#240).
51
+ - **The automatic checks failed on any project whose `tests/` folder has no `__init__.py`**, with
52
+ `Start directory is not importable`, even when every test passed. The model was then asked to fix
53
+ that: in two real runs, one added a `tests/__init__.py` nobody asked for, and the other blamed the project.
54
+ lcode now leaves out `-t .` unless `tests/` is a package.
55
+
56
+ ## [0.60.0] - 2026-11-04
57
+
58
+ ### Changed
59
+
60
+ - **For contributors:** CI type-checks `src/lcode` with basedpyright, and the eight modules that were
61
+ over 1,000 lines are split into smaller ones, with no change in behavior. The code map in
62
+ `docs/how-it-works.md` lists them (#200).
63
+
64
+ ### Fixed
65
+
66
+ - The Valohai MCP server failed to describe an execution with an output that has no name; it now
67
+ shows it as `?`. Found by the type checks that CI now runs on `src/lcode` (#200).
68
+ - **Cancelling in an editor right after sending a request** (lcode acp) could be lost: the request then
69
+ ran to the end. The editor's messages are handled in threads of their own, and the request's own thread
70
+ reset the cancel when it started late, on a busy machine. The cancel now holds. This was also why
71
+ `tests/test_acp.py` failed now and then under load (#200).
72
+ - **`lcode bench --compare`** left out attempts whose tests ran but didn't finish, as if they hadn't
73
+ run, so a change that makes the tests hang could hide a drop. They count as failed now, as in
74
+ Harbor's own mean, and `--compare` reads both runs again from Harbor's results so that they count
75
+ alike. It also gives each run's model speed, and warns when one ran more than 10% slower, which
76
+ makes the tasks' time limits bite more often. On 0.59.0's gate, both showed (#199).
77
+
9
78
  ## [0.59.0] - 2026-11-03
10
79
 
11
80
  ### Added
@@ -1259,7 +1328,9 @@ First public release.
1259
1328
  - `AGENTS.md` project instructions and `/init` to generate them.
1260
1329
  - One-line installer for Linux and macOS.
1261
1330
 
1262
- [Unreleased]: https://github.com/nasser1941/lcode/compare/v0.59.0...HEAD
1331
+ [Unreleased]: https://github.com/nasser1941/lcode/compare/v0.61.0...HEAD
1332
+ [0.61.0]: https://github.com/nasser1941/lcode/compare/v0.60.0...v0.61.0
1333
+ [0.60.0]: https://github.com/nasser1941/lcode/compare/v0.59.0...v0.60.0
1263
1334
  [0.59.0]: https://github.com/nasser1941/lcode/compare/v0.58.0...v0.59.0
1264
1335
  [0.58.0]: https://github.com/nasser1941/lcode/compare/v0.57.0...v0.58.0
1265
1336
  [0.57.0]: https://github.com/nasser1941/lcode/compare/v0.56.0...v0.57.0
@@ -38,6 +38,7 @@ uv run lcode --version # run your working copy
38
38
  uv run pytest # tests
39
39
  uv run ruff check . # lint
40
40
  uv run ruff format . # format
41
+ uv run basedpyright # type check
41
42
  ```
42
43
 
43
44
  Optional: `uvx pre-commit install` runs the linters and a secret scanner before each commit.
@@ -86,7 +87,7 @@ otherwise the first model in catalog order that fits with a useful context windo
86
87
 
87
88
  ## Pull request checklist
88
89
 
89
- - [ ] `uv run pytest` and `uv run ruff check .` pass
90
+ - [ ] `uv run pytest`, `uv run ruff check .` and `uv run basedpyright` pass
90
91
  - [ ] New behavior has tests (the agent loop can be tested with the scripted `FakeOllama` in `tests/conftest.py`)
91
92
  - [ ] User-facing changes are documented in `docs/` and noted under *Unreleased* in `CHANGELOG.md`
92
93
  - [ ] No secrets, tokens, personal paths or private data in code, tests, docs or screenshots
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: lcode-cli
3
- Version: 0.59.0
3
+ Version: 0.61.0
4
4
  Summary: A local-first terminal coding agent powered by open-weight models on your own GPU or Mac, via Ollama.
5
5
  Project-URL: Homepage, https://nasser1941.github.io/lcode/
6
6
  Project-URL: Documentation, https://nasser1941.github.io/lcode/
@@ -86,12 +86,13 @@ aren't tracked.
86
86
  Small models sometimes think in circles: a few paragraphs, over and over, until the context is full.
87
87
  That takes minutes behind the spinner and ends without an answer. lcode watches the thinking as it
88
88
  streams, and when its sentences keep repeating, it stops the model, drops that reply and asks for a
89
- short one: the next tool call, or what's blocking it. The dropped reply is saved, and the message
90
- says where, so you can read what went round in circles. An empty reply, or one that filled the context
91
- before it said anything, gets the same second chance. The second time in a request, lcode stops it
92
- (status `loop`), offering the [stronger model](usage.md#a-stronger-model-when-stuck) first when one
93
- is set. An answer the context cut off midway is kept, with a warning to `/compact` or use a larger
94
- `/context`.
89
+ short one: the next tool call, or what's blocking it. With Ollama, that reply runs with thinking off,
90
+ so the model acts instead of starting the same deliberation over. The dropped reply is saved, and the
91
+ message says where, so you can read what went round in circles. An empty reply, or one that filled the
92
+ context before it said anything, gets the same second chance. When two replies in a row go nowhere, or
93
+ four in one request, lcode stops it (status `loop`), offering the
94
+ [stronger model](usage.md#a-stronger-model-when-stuck) first when one is set. An answer the context
95
+ cut off midway is kept, with a warning to `/compact` or use a larger `/context`.
95
96
 
96
97
  ## Subagents
97
98
 
@@ -157,6 +158,12 @@ Nemotron (Mamba layers) keep a cache in only a few layers, which is why they can
157
158
  tokens on consumer hardware. The budget is GPU memory plus spare RAM on Linux, and the GPU share
158
159
  of unified memory on Apple Silicon. See [Models & context windows](models.md#how-memory-is-estimated).
159
160
 
161
+ That budget says whether a model loads, not whether it keeps its speed. An MoE model's experts stay mapped
162
+ from its file, and Ollama's server keeps a prompt cache of up to 8 GB in RAM. When they don't fit in the RAM
163
+ that's available, Linux keeps dropping the experts and reading them back from disk, at a third of the speed.
164
+ `lcode doctor` and `lcode setup` compare the two with what's available now, and a session says so when replies
165
+ slow down that far. See [RAM in a long session](models.md#ram-in-a-long-session).
166
+
160
167
  Two lessons from tuning the default model on a 12 GB GPU shaped the defaults:
161
168
 
162
169
  - **Vision projectors cost ~1 GB of VRAM** that Ollama under-counts on small GPUs, causing
@@ -181,14 +188,14 @@ the Ollama server you configure, it only contacts the web when the model searche
181
188
 
182
189
  | Module | Responsibility |
183
190
  |---|---|
184
- | `cli.py` | Entry point, subcommands, model and context resolution |
185
- | `repl.py` | Prompt, key bindings, slash commands, status bar |
186
- | `agent.py` | System prompt, streaming, tool loop, compaction, sessions |
187
- | `tools.py` | Tool schemas and implementations |
191
+ | `cli.py`, `cli_args.py`, `doctor.py` | Entry point, subcommands, model and context resolution; the options; `lcode doctor` |
192
+ | `repl.py` | Prompt, key bindings, status bar, and slash commands, with the model, media, memory and checkpoint, and session commands in `repl_models.py`, `repl_media.py`, `repl_history.py` and `repl_sessions.py` |
193
+ | `agent.py` | The tool loop. `Agent`'s state is in `agent_base.py`, and its system prompt and tools, model calls, context window, sessions and checks in `agent_prompt.py`, `agent_model.py`, `agent_context.py`, `agent_sessions.py` and `agent_checks.py` |
194
+ | `tools.py` | The tools and running them, with the schemas in `tool_schemas.py`, what they share in `tool_helpers.py` and `tools_base.py`, and the file and shell tools in `tools_edit.py` and `tools_shell.py` |
188
195
  | `permissions.py` | Approval prompts and the read-only allowlist |
189
196
  | `servers/` | The MCP servers lcode ships for services without one: Encord, Valohai |
190
197
  | `mcp/` | MCP client: stdio and HTTP transports, OAuth sign-in, server settings, the catalog, `lcode mcp` |
191
- | `bench.py` | `lcode bench`: the benchmark tasks, their checks and the reports |
198
+ | `bench.py` | `lcode bench`: running the tasks and the reports; the tasks are in `bench_quick.py` and the other `bench_*.py`, and what their checks share in `bench_checks.py` |
192
199
  | `vision.py` | Looking at images with a model that can see |
193
200
  | `subagents.py` | Subagents: agent types, running them (also in parallel), worktrees for workers |
194
201
  | `hooks.py` | Hooks on lcode's events, and allow and deny rules for permissions |
@@ -202,6 +209,9 @@ the Ollama server you configure, it only contacts the web when the model searche
202
209
  | `sandbox.py` | The optional container for shell commands |
203
210
  | `checkpoints.py` | Snapshots before the model changes files, for `/undo` and `/rewind` |
204
211
  | `catalog.py`, `models.toml` | Model catalog and memory estimates |
205
- | `hardware.py` | NVIDIA / Apple Silicon detection |
212
+ | `hardware.py` | NVIDIA / Apple Silicon detection, and the RAM available now |
206
213
  | `ollama.py` | Ollama HTTP client |
207
214
  | `config.py` | Settings file and environment variables |
215
+ | `traces.py`, `trace_view.py`, `trace_export.py` | Recording requests; listing and showing traces; exporting them with secrets masked |
216
+ | `media.py`, `media_video.py`, `clips.py` | Image and video mode's jobs in ComfyUI; video jobs and long clips; video files |
217
+ | `screenshots.py`, `screenshots_web.py`, `qt_hook.py` | The screenshot tool: programs, web pages, and the hook it puts into Qt programs |
@@ -121,6 +121,7 @@ lcode doctor
121
121
  ✓ Ollama http://localhost:11434 · version 0.32.15
122
122
  ✓ Model qwen3.6-35b → lcode-qwen3.6-35b
123
123
  ✓ Context 256K tokens · ~28 GB needed, ~35 GB available
124
+ ✓ RAM ~27 GB available now, ~26 GB needed in a long session: ~16 GB of the model that doesn't fit on the GPU, up to 10 GB for Ollama's server and prompt cache
124
125
  ✓ ripgrep found
125
126
  ✓ git found
126
127
  ```
@@ -247,6 +247,25 @@ The **memory available** for a model is:
247
247
  lets the GPU use by default.
248
248
  - **Linux with NVIDIA:** GPU memory plus system RAM minus ~8 GB for the OS and your apps.
249
249
 
250
+ ### RAM in a long session
251
+
252
+ The estimate above says whether a model loads. Whether it keeps its speed depends on the RAM that's
253
+ available now, next to your other programs:
254
+
255
+ ```
256
+ RAM needed ≈ memory − GPU memory + ~10 GB for Ollama's server and prompt cache
257
+ ```
258
+
259
+ - **The part of the model that doesn't fit on the GPU.** A Mixture-of-Experts model's experts stay
260
+ mapped from the model's file, so they have to stay in Linux's page cache. `ollama ps` leaves them out:
261
+ it shows `qwen3.6-35b` at 32K as 10.5 GB, with ~12 GB more in RAM.
262
+ - **Ollama's prompt cache**, which grows to 8 GB in a long session, next to 1–2 GB of the server's own.
263
+
264
+ On a 12 GB GPU, `qwen3.6-35b` needs ~21 GB of RAM at 32K, ~23 GB at 128K and ~26 GB at 256K. On Linux,
265
+ when Ollama runs on the same machine, `lcode doctor` and `lcode setup` compare that with what's available.
266
+ If it's short, replies fall to about a third of their speed after a while: see
267
+ [Troubleshooting](troubleshooting.md#it-starts-fast-then-gets-about-three-times-slower).
268
+
250
269
  ## Hardware guide
251
270
 
252
271
  What `lcode setup` recommends on common machines: the tested default when it fits, otherwise the
@@ -86,9 +86,14 @@ With three attempts, the last line also gives each run's pass rate and the sprea
86
86
  [trace](traces.md)). An attempt stopped at the task's time limit counts the tokens recorded
87
87
  until then, and a reply lcode stopped counts with an estimate. `–` means no attempt of the task
88
88
  has a record.
89
+ - **The model's speed**: how many tokens per second it generated, in the median attempt, from the
90
+ same traces. A slower machine (short of memory, or busy with other programs) runs into the
91
+ tasks' time limits more often.
89
92
 
90
93
  Attempts whose container didn't start (a failed image download, say) count neither as passed nor
91
- as failed. The report shows how many there were.
94
+ as failed. Attempts whose tests ran but didn't finish (a time limit, say) or gave no result count
95
+ as failed, as in Harbor's own mean, so a change that makes the tests hang can't hide a drop. The
96
+ report shows how many of each there were.
92
97
 
93
98
  Everything is saved in `~/.local/state/lcode/bench/<slice>-<time>/`:
94
99
 
@@ -111,6 +116,11 @@ It says which lcode, model and context each one ran, warns when they don't match
111
116
  whose results changed (`3/3 → 1/3`), and compares pass@1 over the tasks both ran: within the noise,
112
117
  better, or a drop beyond the noise.
113
118
 
119
+ While Harbor's results are still on the machine, `--compare` reads both runs from them again, so a
120
+ run saved by an older lcode counts its attempts the same way as a new one. It also gives each run's
121
+ model speed, and warns when one ran more than 10% slower: more of its attempts run into their time
122
+ limits, so part of a difference can come from the machine rather than from lcode.
123
+
114
124
  The noise is how far pass@1 moves between runs of the same setup, estimated from how much each
115
125
  task's attempts disagree: a task that always passes or always fails adds nothing, one that passes
116
126
  half the time the most. A change counts when it's more than twice the standard error of the
@@ -12,7 +12,7 @@ lcode
12
12
 
13
13
  ```text
14
14
  ╭──────────────────────────────────────────────╮
15
- │ lcode v0.59.0 — local coding agent │
15
+ │ lcode v0.61.0 — local coding agent │
16
16
  │ │
17
17
  │ model lcode-qwen3.6-35b │
18
18
  │ context 256K tokens │
@@ -22,7 +22,9 @@ lcode trace path # the folder the traces are in
22
22
  the total time, and the tokens in and out. With Ollama, also how long loading the model and
23
23
  reading the prompt took. The server counts a reply's tokens only when the reply ends, so for one
24
24
  lcode stopped (it went round in circles, or you interrupted it) the trace has an estimate:
25
- `estimated_in` and `estimated_out`, shown as "about".
25
+ `estimated_in` and `estimated_out`, shown as "about". A reply asked for without thinking has
26
+ `think: false`: thinking is turned off, or the reply before it
27
+ [went nowhere](how-it-works.md#when-a-reply-goes-nowhere).
26
28
  - **Each tool call:** its arguments, the result the model got, and how long it took. A result
27
29
  longer than 200,000 characters keeps its start and end. When lcode cut a long output for the
28
30
  model, the result says where the full output was saved.
@@ -88,6 +88,39 @@ need `lcode mcp login <name>`. More in [MCP servers: Troubleshooting](mcp.md#tro
88
88
  prefer the MoE models in `lcode models` on smaller GPUs.
89
89
  - `--no-think` skips reasoning for simple requests.
90
90
 
91
+ ### It starts fast, then gets about three times slower
92
+
93
+ The machine is short of RAM. A model that doesn't fit on the GPU keeps the rest in RAM, and Ollama's
94
+ server keeps a prompt cache there that grows to 8 GB in a long session. When those don't fit next to
95
+ your other programs, Linux drops the model from memory and keeps reading it back from disk.
96
+
97
+ Measured with `qwen3.6-35b` at 32K on an RTX 4080 Laptop GPU (12 GB) with 31 GB of RAM: generation fell
98
+ from about 65 to about 20 tokens/s and prompt reading from about 200 to about 55, with the GPU at 2–14%
99
+ and the disk reading about 1.9 GB/s. A short test right after loading doesn't show it: the slowdown
100
+ starts as the prompt cache fills, within about an hour.
101
+
102
+ `lcode doctor` checks this on Linux, when Ollama runs on the same machine (in Docker too):
103
+
104
+ ```text
105
+ ! RAM ~15 GB available now, ~21 GB needed in a long session: ~11 GB of the model that doesn't
106
+ fit on the GPU, up to 10 GB for Ollama's server and prompt cache
107
+ ```
108
+
109
+ `lcode setup` gives the same warning, and a session says it once when replies fall below half of their
110
+ earlier speed and RAM is short. `ollama ps` doesn't show any of this: for a Mixture-of-Experts model it
111
+ leaves out the experts mapped from the model's file, ~12 GB for `qwen3.6-35b`.
112
+
113
+ What helps:
114
+
115
+ 1. Close other programs before a long session: browsers, IDEs, containers.
116
+ 2. Use a smaller context: `/ctx 64k` in a session or `lcode config set context 64k`. This helps most when
117
+ the window is large: going from 256K to 32K saves ~5 GB with `qwen3.6-35b`.
118
+ 3. Pick a smaller model that fits on the GPU: `lcode models`.
119
+ 4. To empty the prompt cache right away, unload the model: `ollama stop <model>`. The next request
120
+ reloads it, and the cache fills up again over time.
121
+
122
+ On a Mac, `lcode doctor` doesn't check this yet: see [below](#on-a-mac-a-model-that-should-fit-gets-very-slow).
123
+
91
124
  ### The model prints tool calls as text instead of running them
92
125
 
93
126
  The model doesn't support Ollama's tool calling well. lcode recovers common formats, but results
@@ -261,6 +261,17 @@ lcode sends it back once before the answer counts: run it and fix what fails, or
261
261
  it's untested and why, when running it would install, deploy or delete things. Making it executable
262
262
  or reading it doesn't count as running it. `checks = "off"` turns this off too.
263
263
 
264
+ **Code it never ran.** A model that writes a new module and finds no Python, or checks only its
265
+ syntax, tends to call it done, and the first run shows the error. When a request wrote a new code
266
+ file (Python, JavaScript, TypeScript, Rust, Go, C, Java and other languages that run) and no command
267
+ since its last change ran it, lcode sends it back once: run it (import a module and call what it
268
+ wrote; start a server in the background and try it) and fix what fails, or say plainly that it's
269
+ untested and why. A command counts when it names the file or its module, or runs tests, and its
270
+ program was there: a syntax, lint or type check, `python3: command not found` or a command that
271
+ only reads doesn't count. When `uv` is installed, the note adds that `uv run --with PACKAGE python FILE` runs
272
+ Python code in a throwaway environment. A project with checks of its own gets those instead, and a
273
+ window gets the screenshot check above. `checks = "off"` turns this off too.
274
+
264
275
  ## A review before the answer
265
276
 
266
277
  Models claim more than they did: half of a two-part request done, "it works now" without having
@@ -305,8 +316,8 @@ lcode config set escalate_price 3/15 # dollars per million tokens
305
316
 
306
317
  **When.** lcode offers it when the [loop breaker](how-it-works.md#when-the-model-repeats-itself)
307
318
  would stop the request, when the model's replies [go nowhere](how-it-works.md#when-a-reply-goes-nowhere)
308
- twice, and when the project's [checks](#checks-before-done) fail twice in a row after the model's
309
- fixes, at most once per request. Not for a [site this machine can't reach](how-it-works.md#when-a-site-cant-be-reached):
319
+ twice in a row (or four times in one request), and when the project's [checks](#checks-before-done)
320
+ fail twice in a row after the model's fixes, at most once per request. Not for a [site this machine can't reach](how-it-works.md#when-a-site-cant-be-reached):
310
321
  a stronger model can't reach it either. You can also ask at any time: `/escalate`, or
311
322
  `/escalate the window still grows` to say what's wrong.
312
323
 
@@ -351,11 +362,24 @@ since last time with `bash_output`, and stops it with `bash_stop`.
351
362
  ```
352
363
 
353
364
  - `/jobs` lists the background commands; `/jobs stop 1` stops one.
354
- - They all stop when the session ends.
365
+ - They stop when the session ends, except **kept** ones. When you ask for a service that stays up
366
+ after lcode is done ("start the docs server and leave it running"), the model adds
367
+ `keep: true`. A kept command writes its output to a log in `~/.local/state/lcode/jobs/`, and at
368
+ the end lcode says what it left running and how to stop it:
369
+
370
+ ```text
371
+ Left job 1 running, as asked: mkdocs serve (process group 48211: `kill -- -48211` stops it; its
372
+ output is in ~/.local/state/lcode/jobs/20261103-141502-3fa9c1.log)
373
+ ```
374
+
355
375
  - Anything else a command starts with `&` is stopped when that command ends. Only background
356
376
  commands keep running, so no process outlives the session unnoticed.
357
377
  - Background commands ask for permission like any other command, and run in the
358
- [sandbox](sandbox.md) when it's on.
378
+ [sandbox](sandbox.md) when it's on. A command in the sandbox can't be kept: the sandbox stops
379
+ with lcode.
380
+ - A kept command always asks first, and the question says that it stays running: even a command
381
+ that only reads, or a program you allowed for the session. Only `yolo` mode and an allow rule
382
+ in your settings let it through without asking. Plan mode doesn't run it.
359
383
 
360
384
  ## What's happening under the hood
361
385
 
@@ -379,6 +403,7 @@ stays loaded:
379
403
  | The model that looks at images needs the memory | `Loading the vision model … to look at bug.png; qwen3.6-35b makes room and reloads afterwards`, then `◆ qwen3.6-35b was unloaded to make room…`, and the next step says `Reloading qwen3.6-35b into memory (it made room for the vision model …)` |
380
404
  | A tool needs the GPU to itself (an MCP server with `free_gpu`) | `◆ Unloaded qwen3.6-35b so the server can use the GPU; it reloads afterwards.` |
381
405
  | Ollama ran out of memory | `⚠` what ran out (the prompt batch, or the context next to the model), what lcode retries with, and what it remembers for next time |
406
+ | Replies fell below half of their earlier speed and RAM is short (once a session, on Linux) | `⚠ Replies slowed from 65 to 20 tokens a second, most likely because RAM is short: ~15 GB available now, ~21 GB needed in a long session…`, with what to do. See [Troubleshooting](troubleshooting.md#it-starts-fast-then-gets-about-three-times-slower) |
382
407
 
383
408
  While the model loads in the background at startup, the status bar says
384
409
  `loading the model into memory…`. Mixture-of-Experts models, such as qwen3.6-35b, run well with
@@ -52,7 +52,11 @@ lcode-mcp-encord = "lcode.servers.encord:main"
52
52
  lcode-mcp-xai = "lcode.servers.xai:main"
53
53
 
54
54
  [dependency-groups]
55
- dev = ["pytest>=8", "ruff>=0.6"]
55
+ dev = [
56
+ "basedpyright>=1.40.2",
57
+ "pytest>=8",
58
+ "ruff>=0.6",
59
+ ]
56
60
  docs = ["mkdocs-material>=9.5", "mkdocs>=1.6,<2"] # MkDocs 2 drops plugins and themes
57
61
 
58
62
  [tool.hatch.version]
@@ -83,6 +87,8 @@ ignore = [
83
87
 
84
88
  [tool.ruff.lint.per-file-ignores]
85
89
  "src/lcode/agent.py" = ["E501"] # the prompts are prose; wrapping them would change what the model sees
90
+ "src/lcode/agent_prompt.py" = ["E501"] # the same prompts, moved here
91
+ "src/lcode/agent_context.py" = ["E501"] # the summary prompt is prose
86
92
  "src/lcode/manual.py" = ["E501"] # the same for the help prompt
87
93
  "src/lcode/memory.py" = ["E501"]
88
94
  "src/lcode/subagents.py" = ["E501"]
@@ -107,3 +113,9 @@ ignore = [
107
113
  [tool.pytest.ini_options]
108
114
  testpaths = ["tests"]
109
115
  addopts = "-q"
116
+
117
+ [tool.basedpyright]
118
+ # CI type-checks src/lcode (`uv run basedpyright`). Python 3.10, the oldest lcode supports, so newer APIs show up.
119
+ include = ["src/lcode"]
120
+ pythonVersion = "3.10"
121
+ typeCheckingMode = "standard"
@@ -3,7 +3,7 @@
3
3
  From a program: `from lcode import Session` (see lcode.api).
4
4
  """
5
5
 
6
- __version__ = "0.59.0"
6
+ __version__ = "0.61.0"
7
7
 
8
8
  API = ("Session", "Result", "Options", "SetupError")
9
9
 
@@ -19,11 +19,13 @@ the file in LCODE_ACP_LOG), and stdin is the protocol channel only.
19
19
  from __future__ import annotations
20
20
 
21
21
  import base64
22
+ import contextlib
22
23
  import hashlib
23
24
  import json
24
25
  import os
25
26
  import sys
26
27
  import threading
28
+ from collections.abc import Callable
27
29
  from pathlib import Path
28
30
  from typing import IO, TYPE_CHECKING, Any
29
31
  from urllib.parse import unquote, urlparse
@@ -76,6 +78,9 @@ class Connection:
76
78
  self.pending: dict[int, tuple[threading.Event, dict]] = {}
77
79
  self.next_id = 0
78
80
  self.closed = False
81
+ # Called with each message from the editor in the order they came, before it's handled in a thread of
82
+ # its own: for what has to happen in that order (Server.received).
83
+ self.on_message: Callable[[dict], None] | None = None
79
84
 
80
85
  def send(self, message: dict) -> None:
81
86
  data = (json.dumps({"jsonrpc": "2.0", **message}, ensure_ascii=False) + "\n").encode()
@@ -112,6 +117,9 @@ class Connection:
112
117
  self.send({"id": None, "error": {"code": -32700, "message": "parse error"}})
113
118
  continue
114
119
  if "method" in message:
120
+ if self.on_message is not None:
121
+ with contextlib.suppress(Exception): # never stop reading
122
+ self.on_message(message)
115
123
  threading.Thread(target=self._dispatch, args=(handle, message), daemon=True).start()
116
124
  elif message.get("id") in self.pending:
117
125
  done, slot = self.pending.pop(message["id"])
@@ -373,8 +381,7 @@ class Session:
373
381
  return {"stopReason": "end_turn"}
374
382
  if command is not None:
375
383
  text = command
376
- self.agent.cancel.clear()
377
- result = api.run_request(self.agent, text)
384
+ result = api.run_request(self.agent, text) # its cancel was reset when the prompt arrived (Server.received)
378
385
  self.update({"sessionUpdate": "usage_update", "used": self.agent.ctx_used, "size": self.agent.settings.context})
379
386
  self.update({"sessionUpdate": "session_info_update", "title": self.agent.session_title or None})
380
387
  if result.status == "error":
@@ -472,6 +479,19 @@ class Server:
472
479
  self.conn, self.console = conn, console
473
480
  self.client_caps: dict = {}
474
481
  self.sessions: dict[str, Session] = {}
482
+ conn.on_message = self.received
483
+
484
+ def received(self, message: dict) -> None:
485
+ """A new prompt resets its session's cancel as soon as it arrives, in the order the editor sent things.
486
+
487
+ Each message is then handled in a thread of its own, so a cancel sent right after a prompt can run before
488
+ the prompt's thread starts; the cancel then holds, instead of being reset by a prompt that starts late.
489
+ """
490
+ if message.get("method") == "session/prompt":
491
+ params = message.get("params") or {}
492
+ session = self.sessions.get(str(params.get("sessionId", "")))
493
+ if session is not None and session.agent.cancel is not None:
494
+ session.agent.cancel.clear()
475
495
 
476
496
  def handle(self, method: str, params: dict) -> dict | None:
477
497
  handlers = {