lcode-cli 0.60.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 (260) hide show
  1. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/.github/workflows/ci.yml +3 -3
  2. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/.github/workflows/docs.yml +1 -1
  3. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/.github/workflows/release.yml +1 -1
  4. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/CHANGELOG.md +49 -1
  5. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/PKG-INFO +1 -1
  6. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/docs/how-it-works.md +14 -7
  7. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/docs/installation.md +1 -0
  8. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/docs/models.md +19 -0
  9. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/docs/quickstart.md +1 -1
  10. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/docs/traces.md +3 -1
  11. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/docs/troubleshooting.md +33 -0
  12. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/docs/usage.md +29 -4
  13. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/__init__.py +1 -1
  14. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/agent.py +49 -12
  15. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/agent_base.py +2 -1
  16. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/agent_checks.py +20 -0
  17. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/agent_model.py +28 -3
  18. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/api.py +6 -1
  19. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/catalog.py +10 -0
  20. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/checks.py +73 -1
  21. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/cli.py +4 -1
  22. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/doctor.py +6 -1
  23. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/hardware.py +31 -8
  24. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/jobs.py +70 -25
  25. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/repl.py +1 -1
  26. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/replay.py +1 -1
  27. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/residency.py +135 -0
  28. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/tool_schemas.py +8 -1
  29. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/tools_base.py +1 -0
  30. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/tools_edit.py +1 -0
  31. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/tools_shell.py +49 -19
  32. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/traces.py +2 -0
  33. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/conftest.py +1 -0
  34. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_catalog.py +11 -0
  35. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_checks.py +23 -2
  36. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_jobs.py +145 -2
  37. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_look.py +4 -2
  38. lcode_cli-0.61.0/tests/test_residency.py +503 -0
  39. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_sandbox.py +12 -0
  40. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_stuck.py +160 -3
  41. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_traces.py +1 -0
  42. lcode_cli-0.60.0/tests/test_residency.py +0 -164
  43. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/.editorconfig +0 -0
  44. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/.github/CODEOWNERS +0 -0
  45. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
  46. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  47. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
  48. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/.github/ISSUE_TEMPLATE/model_request.yml +0 -0
  49. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  50. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/.github/dependabot.yml +0 -0
  51. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/.gitignore +0 -0
  52. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/.pre-commit-config.yaml +0 -0
  53. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/AGENTS.md +0 -0
  54. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/CODE_OF_CONDUCT.md +0 -0
  55. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/CONTRIBUTING.md +0 -0
  56. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/LICENSE +0 -0
  57. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/README.md +0 -0
  58. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/SECURITY.md +0 -0
  59. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/action.yml +0 -0
  60. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/docs/agents.md +0 -0
  61. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/docs/assets/demo.svg +0 -0
  62. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/docs/assets/extra.css +0 -0
  63. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/docs/assets/film-fox-and-kitten.jpg +0 -0
  64. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/docs/assets/long-clip-tulip.jpg +0 -0
  65. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/docs/automation.md +0 -0
  66. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/docs/bench.md +0 -0
  67. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/docs/changelog.md +0 -0
  68. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/docs/commands.md +0 -0
  69. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/docs/configuration.md +0 -0
  70. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/docs/contributing.md +0 -0
  71. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/docs/editors.md +0 -0
  72. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/docs/git.md +0 -0
  73. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/docs/hooks.md +0 -0
  74. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/docs/index.md +0 -0
  75. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/docs/lsp.md +0 -0
  76. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/docs/mcp.md +0 -0
  77. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/docs/memory.md +0 -0
  78. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/docs/modes.md +0 -0
  79. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/docs/public-benchmarks.md +0 -0
  80. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/docs/sandbox.md +0 -0
  81. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/docs/search.md +0 -0
  82. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/docs/servers.md +0 -0
  83. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/examples/README.md +0 -0
  84. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/examples/api/fix_tests.py +0 -0
  85. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/examples/commands/review.md +0 -0
  86. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/examples/skills/commit-message/SKILL.md +0 -0
  87. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/examples/skills/commit-message/scripts/staged.sh +0 -0
  88. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/install.sh +0 -0
  89. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/mkdocs.yml +0 -0
  90. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/overrides/main.html +0 -0
  91. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/pyproject.toml +0 -0
  92. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/scripts/make_logos.py +0 -0
  93. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/scripts/record_demo.py +0 -0
  94. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/scripts/social-preview.html +0 -0
  95. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/__main__.py +0 -0
  96. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/acp.py +0 -0
  97. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/action.py +0 -0
  98. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/agent_context.py +0 -0
  99. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/agent_prompt.py +0 -0
  100. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/agent_sessions.py +0 -0
  101. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/assistant.py +0 -0
  102. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/backends.py +0 -0
  103. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/bench.py +0 -0
  104. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/bench_backend.py +0 -0
  105. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/bench_budgets.py +0 -0
  106. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/bench_checks.py +0 -0
  107. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/bench_dedupe.py +0 -0
  108. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/bench_flaky.py +0 -0
  109. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/bench_logsum.py +0 -0
  110. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/bench_quick.py +0 -0
  111. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/bench_quotes.py +0 -0
  112. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/bench_runtime.py +0 -0
  113. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/checkpoints.py +0 -0
  114. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/cli_args.py +0 -0
  115. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/clipboard.py +0 -0
  116. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/clips.py +0 -0
  117. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/cloud.py +0 -0
  118. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/codesearch.py +0 -0
  119. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/comfy.py +0 -0
  120. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/config.py +0 -0
  121. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/context.py +0 -0
  122. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/edits.py +0 -0
  123. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/escalate.py +0 -0
  124. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/extensions.py +0 -0
  125. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/film.py +0 -0
  126. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/frontmatter.py +0 -0
  127. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/gitflow.py +0 -0
  128. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/harbor.py +0 -0
  129. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/harbor_bench.py +0 -0
  130. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/hooks.py +0 -0
  131. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/imageopts.py +0 -0
  132. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/limits.py +0 -0
  133. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/lsp.py +0 -0
  134. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/manual.py +0 -0
  135. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/matching.py +0 -0
  136. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/mcp/__init__.py +0 -0
  137. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/mcp/auth.py +0 -0
  138. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/mcp/catalog.py +0 -0
  139. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/mcp/catalog.toml +0 -0
  140. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/mcp/client.py +0 -0
  141. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/mcp/commands.py +0 -0
  142. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/mcp/config.py +0 -0
  143. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/mcp/http.py +0 -0
  144. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/mcp/manager.py +0 -0
  145. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/mcp/protocol.py +0 -0
  146. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/mcp/server.py +0 -0
  147. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/mcp/stdio.py +0 -0
  148. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/media.py +0 -0
  149. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/media.toml +0 -0
  150. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/media_catalog.py +0 -0
  151. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/media_cloud.py +0 -0
  152. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/media_video.py +0 -0
  153. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/memory.py +0 -0
  154. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/models.toml +0 -0
  155. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/modes.py +0 -0
  156. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/notify.py +0 -0
  157. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/ollama.py +0 -0
  158. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/permissions.py +0 -0
  159. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/planning.py +0 -0
  160. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/preview.py +0 -0
  161. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/qt_hook.py +0 -0
  162. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/render.py +0 -0
  163. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/repeats.py +0 -0
  164. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/repl_history.py +0 -0
  165. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/repl_media.py +0 -0
  166. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/repl_models.py +0 -0
  167. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/repl_sessions.py +0 -0
  168. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/repoid.py +0 -0
  169. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/repomap.py +0 -0
  170. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/review.py +0 -0
  171. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/sandbox.py +0 -0
  172. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/screenshots.py +0 -0
  173. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/screenshots_web.py +0 -0
  174. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/secretscan.py +0 -0
  175. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/servers/__init__.py +0 -0
  176. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/servers/encord.py +0 -0
  177. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/servers/valohai.py +0 -0
  178. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/servers/xai.py +0 -0
  179. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/sessions.py +0 -0
  180. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/steer.py +0 -0
  181. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/subagents.py +0 -0
  182. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/tool_helpers.py +0 -0
  183. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/tools.py +0 -0
  184. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/trace_export.py +0 -0
  185. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/trace_view.py +0 -0
  186. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/unreachable.py +0 -0
  187. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/update.py +0 -0
  188. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/vision.py +0 -0
  189. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/web.py +0 -0
  190. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/workflows/__init__.py +0 -0
  191. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/workflows/flux2-klein-4b-t2i.json +0 -0
  192. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/workflows/remove-background.json +0 -0
  193. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/workflows/smooth-film.json +0 -0
  194. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/workflows/sound-stable-audio.json +0 -0
  195. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/workflows/upscale-esrgan.json +0 -0
  196. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/workflows/upscale-video-esrgan.json +0 -0
  197. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/workflows/wan21-fun-camera.json +0 -0
  198. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/workflows/wan21-vace.json +0 -0
  199. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/workflows/wan22-fun-inp-5b.json +0 -0
  200. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/workflows/wan22-ti2v-5b.json +0 -0
  201. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/src/lcode/workflows/z-image-turbo-t2i.json +0 -0
  202. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/comfy_standin.py +0 -0
  203. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/fake_lsp_server.py +0 -0
  204. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/fake_mcp_server.py +0 -0
  205. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_acp.py +0 -0
  206. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_action.py +0 -0
  207. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_agent.py +0 -0
  208. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_api.py +0 -0
  209. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_assistant.py +0 -0
  210. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_backends.py +0 -0
  211. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_bench.py +0 -0
  212. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_bench_work.py +0 -0
  213. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_checkpoints.py +0 -0
  214. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_cli.py +0 -0
  215. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_clipboard.py +0 -0
  216. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_cloud.py +0 -0
  217. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_codesearch.py +0 -0
  218. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_comfy.py +0 -0
  219. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_config.py +0 -0
  220. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_context.py +0 -0
  221. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_context_picker.py +0 -0
  222. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_conversations.py +0 -0
  223. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_escalate.py +0 -0
  224. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_extensions.py +0 -0
  225. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_film.py +0 -0
  226. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_gitflow.py +0 -0
  227. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_gpu_handover.py +0 -0
  228. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_harbor_bench.py +0 -0
  229. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_hooks.py +0 -0
  230. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_image_edit.py +0 -0
  231. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_image_generate.py +0 -0
  232. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_long_clips.py +0 -0
  233. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_lsp.py +0 -0
  234. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_manual.py +0 -0
  235. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_matching.py +0 -0
  236. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_mcp.py +0 -0
  237. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_media_catalog.py +0 -0
  238. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_media_cloud.py +0 -0
  239. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_memory.py +0 -0
  240. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_model_picker.py +0 -0
  241. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_modes.py +0 -0
  242. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_permissions.py +0 -0
  243. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_plan_mode.py +0 -0
  244. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_repeats.py +0 -0
  245. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_repomap.py +0 -0
  246. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_review.py +0 -0
  247. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_robustness.py +0 -0
  248. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_screenshots.py +0 -0
  249. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_secretscan.py +0 -0
  250. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_servers.py +0 -0
  251. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_sessions.py +0 -0
  252. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_steer.py +0 -0
  253. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_subagents.py +0 -0
  254. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_tools.py +0 -0
  255. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_update.py +0 -0
  256. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_video.py +0 -0
  257. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_vision.py +0 -0
  258. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_web.py +0 -0
  259. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/tests/test_xai.py +0 -0
  260. {lcode_cli-0.60.0 → lcode_cli-0.61.0}/uv.lock +0 -0
@@ -18,7 +18,7 @@ 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
24
  - name: Type check
@@ -36,7 +36,7 @@ jobs:
36
36
  python: ["3.10", "3.11", "3.12", "3.13", "3.14"]
37
37
  steps:
38
38
  - uses: actions/checkout@v7
39
- - uses: astral-sh/setup-uv@v10.3.2
39
+ - uses: astral-sh/setup-uv@v10.3.3
40
40
  with:
41
41
  python-version: ${{ matrix.python }}
42
42
  - run: uv run --group dev pytest
@@ -46,7 +46,7 @@ jobs:
46
46
  runs-on: ubuntu-latest
47
47
  steps:
48
48
  - uses: actions/checkout@v7
49
- - uses: astral-sh/setup-uv@v10.3.2
49
+ - uses: astral-sh/setup-uv@v10.3.3
50
50
  - run: uv build
51
51
  - name: Check the wheel ships the model catalog
52
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)
@@ -6,6 +6,53 @@ 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
+
9
56
  ## [0.60.0] - 2026-11-04
10
57
 
11
58
  ### Changed
@@ -1281,7 +1328,8 @@ First public release.
1281
1328
  - `AGENTS.md` project instructions and `/init` to generate them.
1282
1329
  - One-line installer for Linux and macOS.
1283
1330
 
1284
- [Unreleased]: https://github.com/nasser1941/lcode/compare/v0.60.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
1285
1333
  [0.60.0]: https://github.com/nasser1941/lcode/compare/v0.59.0...v0.60.0
1286
1334
  [0.59.0]: https://github.com/nasser1941/lcode/compare/v0.58.0...v0.59.0
1287
1335
  [0.58.0]: https://github.com/nasser1941/lcode/compare/v0.57.0...v0.58.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: lcode-cli
3
- Version: 0.60.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
@@ -202,7 +209,7 @@ 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 |
208
215
  | `traces.py`, `trace_view.py`, `trace_export.py` | Recording requests; listing and showing traces; exporting them with secrets masked |
@@ -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
@@ -12,7 +12,7 @@ lcode
12
12
 
13
13
  ```text
14
14
  ╭──────────────────────────────────────────────╮
15
- │ lcode v0.60.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
@@ -3,7 +3,7 @@
3
3
  From a program: `from lcode import Session` (see lcode.api).
4
4
  """
5
5
 
6
- __version__ = "0.60.0"
6
+ __version__ = "0.61.0"
7
7
 
8
8
  API = ("Session", "Result", "Options", "SetupError")
9
9
 
@@ -42,7 +42,8 @@ from lcode.tool_helpers import ToolError, is_binary, tree
42
42
  if TYPE_CHECKING:
43
43
  pass
44
44
 
45
- MAX_STALLS = 2 # replies that go round in circles or say nothing, per request, before lcode stops it
45
+ MAX_STALLS = 2 # replies in a row that go round in circles or say nothing, before lcode stops the request
46
+ MAX_STALLS_PER_REQUEST = 4 # such replies in one request, even with work in between
46
47
  STALLED = {
47
48
  "circles": "the reply went round in circles, so lcode stopped it",
48
49
  "cut_off": "the reply filled the context before it said anything",
@@ -50,15 +51,16 @@ STALLED = {
50
51
  }
51
52
 
52
53
 
53
- def stall_note(trouble: str) -> str:
54
+ def stall_note(trouble: str, thinking_off: bool = False) -> str:
54
55
  """What the model is told after a reply that went round in circles or ended without a word."""
55
56
  first = {
56
57
  "circles": "Your last reply went round in circles (the same thoughts over and over), so lcode stopped it.",
57
58
  "cut_off": "Your last reply filled the rest of the context before you said anything.",
58
59
  "": "Your last reply was empty.",
59
60
  }[trouble]
61
+ off = ": thinking is off for this reply" if thinking_off else ""
60
62
  return (
61
- f"[lcode] {first} Don't deliberate at length now. Either make your next tool call, or, if you're stuck, "
63
+ f"[lcode] {first} Don't deliberate at length now{off}. Either make your next tool call, or, if you're stuck, "
62
64
  "tell the user in a few lines what you did, what fails, and what they could do. If you were about to check "
63
65
  "something by running it, run it now instead of reasoning about it: for a window, take a screenshot (with "
64
66
  "actions for clicks or keys)."
@@ -280,9 +282,13 @@ class Agent(PromptParts, Sessions, Checks, ContextWindow, ModelCalls):
280
282
  malformed = 0
281
283
  looping = "" # the call the model kept repeating, when lcode stopped the request for it
282
284
  blocked = None # the site that couldn't be reached, when lcode stopped the request for it
283
- stalls = 0 # replies that went round in circles or ended without a word
285
+ stalls = 0 # replies in a row that went round in circles or ended without a word
286
+ stalled = 0 # such replies in this request
284
287
  commands: list[str] = [] # shell commands run in this request
285
288
  scripts_noted = False # the model was told about scripts it wrote and never ran
289
+ untested: dict[str, None] = {} # code files the model wrote in this request and hasn't run since (#242)
290
+ untested_noted = False # the model was told about them
291
+ missing: dict[str, None] = {} # programs a command in this request found missing
286
292
  tools_used: set[str] = set() # tools called in this request
287
293
  windows_noted = False # the model was told about windows it changed and never looked at
288
294
  for step in range(self.max_steps):
@@ -294,7 +300,8 @@ class Agent(PromptParts, Sessions, Checks, ContextWindow, ModelCalls):
294
300
  self.save() # a crash or a closed terminal loses at most this step
295
301
  self.maybe_compact()
296
302
  try:
297
- reply = self.assistant_step()
303
+ # After a reply that went nowhere, the next one runs without thinking, so the model acts.
304
+ reply = self.assistant_step(think=not (stalls and self.can_skip_thinking()))
298
305
  calls = reply.get("tool_calls") or []
299
306
  for i, call in enumerate(calls):
300
307
  call.setdefault("id", f"call_{step}_{i}") # so a tool result can name its call
@@ -336,15 +343,22 @@ class Agent(PromptParts, Sessions, Checks, ContextWindow, ModelCalls):
336
343
  continue
337
344
  if not calls and (self.reply_trouble == "circles" or not (reply.get("content") or "").strip()):
338
345
  stalls += 1
346
+ stalled += 1
339
347
  dropped = self.messages.pop() # no answer, and circles would only fill the context
340
348
  kept = self.keep_dropped(dropped)
341
- if stalls < MAX_STALLS:
349
+ if stalls < MAX_STALLS and stalled < MAX_STALLS_PER_REQUEST:
350
+ # The next reply runs with thinking off: asked again with it on, the model mostly started
351
+ # the same deliberation over (all 6 polyglot-rust-c attempts on the dev slice, #241).
352
+ pause = self.settings.think and self.can_skip_thinking()
353
+ off = ", with thinking off" if pause else ""
342
354
  self.console.print(
343
- Text(f" ⎿ {STALLED[self.reply_trouble]}: asking for a short answer{kept}", style="yellow")
355
+ Text(f" ⎿ {STALLED[self.reply_trouble]}: asking for a short answer{off}{kept}", style="yellow")
344
356
  )
345
- self.messages.append({"role": "user", "content": stall_note(self.reply_trouble)})
357
+ note = stall_note(self.reply_trouble, thinking_off=pause)
358
+ self.messages.append({"role": "user", "content": note})
346
359
  continue
347
- why = "its replies went round in circles or ended without an answer, twice in this request"
360
+ times = "twice in a row" if stalls >= MAX_STALLS else f"{stalled} times in this request"
361
+ why = f"its replies went round in circles or ended without an answer, {times}"
348
362
  if not escalated and self.can_escalate():
349
363
  escalated = True
350
364
  advice = self.ask_stronger(why)
@@ -355,12 +369,13 @@ class Agent(PromptParts, Sessions, Checks, ContextWindow, ModelCalls):
355
369
  self.turn_status = "loop"
356
370
  self.console.print(
357
371
  Text(
358
- "Stopped: the model's replies went round in circles or ended without an answer, twice in "
359
- f"this request{kept}. Try again with a smaller step, or tell it what to do differently.",
372
+ f"Stopped: the model's replies went round in circles or ended without an answer, {times}"
373
+ f"{kept}. Try again with a smaller step, or tell it what to do differently.",
360
374
  style="yellow",
361
375
  )
362
376
  )
363
377
  return
378
+ stalls = 0 # it acted or answered: a later reply that goes nowhere starts the count again
364
379
  if not calls:
365
380
  if self.reply_trouble == "cut_off":
366
381
  self.say(
@@ -383,6 +398,19 @@ class Agent(PromptParts, Sessions, Checks, ContextWindow, ModelCalls):
383
398
  )
384
399
  self.messages.append({"role": "user", "content": checks.unseen_note(unseen)})
385
400
  continue
401
+ untried = [] if untested_noted else self.untested_code(untested)
402
+ if untried:
403
+ untested_noted = True
404
+ it = "it" if len(untried) == 1 else "them"
405
+ self.console.print(
406
+ Text(
407
+ f" ⎿ never ran {', '.join(untried)} after writing {it}: asking the model to",
408
+ style="yellow",
409
+ )
410
+ )
411
+ note = checks.untested_note(untried, list(missing), checks.uv_available())
412
+ self.messages.append({"role": "user", "content": note})
413
+ continue
386
414
  check = self.project_check() if changed and not verified else None
387
415
  if check is not None and check_rounds < checks.MAX_ROUNDS:
388
416
  check_rounds += 1
@@ -436,6 +464,7 @@ class Agent(PromptParts, Sessions, Checks, ContextWindow, ModelCalls):
436
464
  began = time.monotonic()
437
465
  if self.trace is not None:
438
466
  self.trace.tool_begin()
467
+ self.tools.wrote = []
439
468
  try:
440
469
  result = done[i] if i in done else self.run_tool(name, args)
441
470
  except KeyboardInterrupt:
@@ -479,8 +508,16 @@ class Agent(PromptParts, Sessions, Checks, ContextWindow, ModelCalls):
479
508
  if out_of_reach.stop:
480
509
  blocked = out_of_reach
481
510
  tools_used.add(name)
511
+ for rel in self.tools.wrote:
512
+ if self.tools.before.get(rel, "") is None and checks.is_code(rel):
513
+ untested[rel] = None # new in this request: it should run before the model says it works
482
514
  if name == "bash":
483
- commands.append(str(args.get("command", "")))
515
+ command = str(args.get("command", ""))
516
+ commands.append(command)
517
+ if not result.startswith(REFUSED): # a command that wasn't allowed, or failed to start, ran nothing
518
+ for rel in checks.exercised(command, result, untested):
519
+ del untested[rel]
520
+ missing.update(dict.fromkeys(checks.not_found(result)))
484
521
  if name in ("edit_file", "write_file", "apply_patch") and not result.startswith(REFUSED):
485
522
  changed, verified = True, False
486
523
  elif name == "bash" and changed and self.model_ran_checks(str(args.get("command", "")), result):
@@ -18,6 +18,7 @@ from lcode import (
18
18
  extensions,
19
19
  repoid,
20
20
  repomap,
21
+ residency,
21
22
  subagents,
22
23
  traces,
23
24
  )
@@ -34,7 +35,6 @@ from lcode.tools import Toolbox
34
35
  from lcode.unreachable import NOTE_AT, Sites
35
36
 
36
37
  if TYPE_CHECKING:
37
- from lcode import residency
38
38
  from lcode.agent import Agent
39
39
  from lcode.agent_model import Progress
40
40
  from lcode.hardware import Hardware
@@ -196,6 +196,7 @@ class AgentBase:
196
196
  self.ctx_used = 0
197
197
  self._repo: tuple[Path, repoid.Repo | None] | None = None # the workspace's repository, for saved sessions
198
198
  self.last_speed = 0.0
199
+ self.reply_speeds = residency.SpeedWatch() # to say why, when replies get far slower (lcode.residency)
199
200
  self.usage = {"requests": 0, "prompt_tokens": 0, "prompt_ns": 0, "output_tokens": 0, "output_ns": 0}
200
201
  self.trace: traces.Lane | None = None # the request's trace while it's recorded (lcode.traces)
201
202
  self.replay: ReplayServer | None = None # in a replay: the recorded results of tools and checks (lcode.replay)
@@ -2,6 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
+ from collections.abc import Iterable
5
6
  from typing import TYPE_CHECKING, cast
6
7
 
7
8
  from lcode import (
@@ -77,6 +78,25 @@ class Checks(AgentBase):
77
78
  return []
78
79
  return checks.unrun_scripts(project_root_or_cwd(self.cwd), list(self.tools.before), commands)
79
80
 
81
+ def untested_code(self, written: Iterable[str]) -> list[str]:
82
+ """Code files the model wrote in this request and hasn't run since their last change (#242): only where the
83
+ checks would run, and when the project has no checks of its own (lcode runs those instead). Window code has
84
+ its own check: a screenshot shows it."""
85
+ if self.allowed_tools is not None or self.planning() or self.no_changes or self.settings.checks == "off":
86
+ return []
87
+ if self.project_check() is not None:
88
+ return []
89
+ root = project_root_or_cwd(self.cwd)
90
+ found = []
91
+ for rel in written:
92
+ path = root / rel
93
+ try:
94
+ if path.is_file() and not checks.GUI_IMPORT.search(path.read_text(errors="replace")):
95
+ found.append(rel)
96
+ except OSError:
97
+ continue
98
+ return found
99
+
80
100
  def unseen_windows(self, tools_used: set[str]) -> dict[str, str]:
81
101
  """Window code the model changed in this request and never looked at (only where the checks would run)."""
82
102
  if self.allowed_tools is not None or self.planning() or self.no_changes or self.settings.checks == "off":
@@ -214,13 +214,22 @@ class ModelCalls(AgentBase):
214
214
  ) from e
215
215
  raise
216
216
 
217
+ def can_skip_thinking(self) -> bool:
218
+ """Whether one reply can be asked for without thinking while thinking is on: Ollama's API has a switch for
219
+ it. Other servers take a chat template argument instead (vLLM, llama.cpp), which hosted APIs refuse, so
220
+ lcode doesn't send it unless thinking is off in the settings."""
221
+ return getattr(self.ollama, "kind", "ollama") == "ollama"
222
+
217
223
  def _opened(self, response) -> None:
218
224
  self.response = response
219
225
  if self.cancel is not None and self.cancel.is_set():
220
226
  subagents.abort(response)
221
227
 
222
- def assistant_step(self) -> dict:
223
- """Stream one model response, rendering thinking/content live. Returns the assistant message."""
228
+ def assistant_step(self, think: bool = True) -> dict:
229
+ """Stream one model response, rendering thinking/content live. Returns the assistant message.
230
+
231
+ `think=False` asks for this reply without thinking, even when thinking is on: after a reply that went
232
+ round in circles, so the model acts instead of starting the same deliberation over."""
224
233
  content, thinking, tool_calls, final = "", "", [], {}
225
234
  md = MarkdownStreamer(self.console)
226
235
  progress = Progress(steering=self.steering)
@@ -243,7 +252,7 @@ class ModelCalls(AgentBase):
243
252
  start_spinner()
244
253
  circles = Circles()
245
254
  self.reply_trouble = ""
246
- stream = self.chat(self.messages, self.tool_schemas(), self.settings.think)
255
+ stream = self.chat(self.messages, self.tool_schemas(), self.settings.think and think)
247
256
  try:
248
257
  for chunk in stream:
249
258
  if self.cancel is not None and self.cancel.is_set():
@@ -315,4 +324,20 @@ class ModelCalls(AgentBase):
315
324
  self.sent_chars = self.counted_chars = conversation_chars(self.messages)
316
325
  seconds = final.get("eval_duration", 0) / 1e9
317
326
  self.last_speed = final.get("eval_count", 0) / seconds if seconds else 0.0
327
+ self.explain_slowdown(final.get("eval_count", 0), seconds)
318
328
  return message
329
+
330
+ def explain_slowdown(self, tokens: int, seconds: float) -> None:
331
+ """When replies fall far below this session's earlier speed and RAM is short, say that's likely why, once."""
332
+ context, spec = self.settings.context, catalog.find(self.settings.model)
333
+ if spec is None or self.hardware is None or self.reply_speeds.explained:
334
+ return
335
+ slowed = self.reply_speeds.add(self.settings.model, context, tokens, seconds)
336
+ fit = residency.ram_fit(self.ollama, spec, context, self.hardware) if slowed else None
337
+ if slowed and fit and fit.short:
338
+ self.reply_speeds.explained = True
339
+ self.say(
340
+ f"Replies slowed from {slowed[0]:.0f} to {slowed[1]:.0f} tokens a second, most likely because RAM is "
341
+ f"short: {fit.describe()}. {fit.advice(residency.SESSION_COMMANDS)}",
342
+ warning=True,
343
+ )
@@ -317,13 +317,18 @@ def open_agent(cwd: Path, options: Options, console: Console, hw: Hardware | Non
317
317
 
318
318
  def close_agent(agent: Agent) -> None:
319
319
  """Stop what lcode started (background jobs, servers, the sandbox, ComfyUI), then say so: the terminal may be
320
- gone already (closed), and saying it then fails."""
320
+ gone already (closed), and saying it then fails. Kept jobs, services the user asked for, keep running."""
321
321
  from lcode import media
322
322
 
323
323
  said = []
324
324
  stopped = agent.jobs.stop_all()
325
325
  if stopped:
326
326
  said.append(f"Stopped {stopped} background job(s).")
327
+ for job in agent.jobs.kept():
328
+ said.append(
329
+ f"Left job {job.id} running, as asked: {job.command} (process group {job.proc.pid}: "
330
+ f"`kill -- -{job.proc.pid}` stops it; its output is in {job.log})"
331
+ )
327
332
  if media.stop_engine(agent):
328
333
  said.append("Stopped ComfyUI.")
329
334
  if agent.lsp is not None: