lcode-cli 0.62.0__tar.gz → 0.63.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.62.0 → lcode_cli-0.63.0}/CHANGELOG.md +54 -1
  2. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/PKG-INFO +1 -1
  3. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/docs/automation.md +2 -0
  4. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/docs/bench.md +10 -4
  5. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/docs/configuration.md +1 -0
  6. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/docs/how-it-works.md +11 -0
  7. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/docs/installation.md +3 -0
  8. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/docs/models.md +2 -1
  9. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/docs/quickstart.md +1 -1
  10. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/docs/troubleshooting.md +14 -2
  11. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/docs/usage.md +14 -2
  12. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/__init__.py +1 -1
  13. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/agent.py +34 -8
  14. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/agent_base.py +2 -1
  15. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/agent_model.py +12 -1
  16. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/api.py +8 -1
  17. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/backends.py +2 -2
  18. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/bench.py +32 -19
  19. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/checks.py +114 -3
  20. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/cli.py +1 -1
  21. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/config.py +1 -0
  22. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/doctor.py +3 -9
  23. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/ollama.py +32 -1
  24. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/repl.py +15 -6
  25. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/replay.py +1 -0
  26. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/residency.py +37 -13
  27. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/subagents.py +1 -0
  28. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/traces.py +3 -3
  29. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_api.py +45 -0
  30. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_bench.py +59 -0
  31. lcode_cli-0.63.0/tests/test_broken_stream.py +182 -0
  32. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_checks.py +62 -0
  33. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_modes.py +3 -0
  34. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_residency.py +57 -9
  35. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_stuck.py +64 -0
  36. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_traces.py +31 -0
  37. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/uv.lock +19 -19
  38. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/.editorconfig +0 -0
  39. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/.github/CODEOWNERS +0 -0
  40. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
  41. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  42. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
  43. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/.github/ISSUE_TEMPLATE/model_request.yml +0 -0
  44. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  45. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/.github/dependabot.yml +0 -0
  46. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/.github/workflows/ci.yml +0 -0
  47. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/.github/workflows/docs.yml +0 -0
  48. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/.github/workflows/release.yml +0 -0
  49. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/.gitignore +0 -0
  50. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/.pre-commit-config.yaml +0 -0
  51. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/AGENTS.md +0 -0
  52. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/CODE_OF_CONDUCT.md +0 -0
  53. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/CONTRIBUTING.md +0 -0
  54. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/LICENSE +0 -0
  55. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/README.md +0 -0
  56. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/SECURITY.md +0 -0
  57. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/action.yml +0 -0
  58. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/docs/agents.md +0 -0
  59. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/docs/assets/demo.svg +0 -0
  60. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/docs/assets/extra.css +0 -0
  61. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/docs/assets/film-fox-and-kitten.jpg +0 -0
  62. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/docs/assets/long-clip-tulip.jpg +0 -0
  63. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/docs/changelog.md +0 -0
  64. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/docs/commands.md +0 -0
  65. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/docs/contributing.md +0 -0
  66. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/docs/editors.md +0 -0
  67. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/docs/git.md +0 -0
  68. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/docs/hooks.md +0 -0
  69. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/docs/index.md +0 -0
  70. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/docs/lsp.md +0 -0
  71. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/docs/mcp.md +0 -0
  72. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/docs/memory.md +0 -0
  73. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/docs/modes.md +0 -0
  74. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/docs/public-benchmarks.md +0 -0
  75. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/docs/sandbox.md +0 -0
  76. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/docs/search.md +0 -0
  77. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/docs/servers.md +0 -0
  78. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/docs/traces.md +0 -0
  79. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/examples/README.md +0 -0
  80. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/examples/api/fix_tests.py +0 -0
  81. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/examples/commands/review.md +0 -0
  82. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/examples/skills/commit-message/SKILL.md +0 -0
  83. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/examples/skills/commit-message/scripts/staged.sh +0 -0
  84. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/install.sh +0 -0
  85. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/mkdocs.yml +0 -0
  86. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/overrides/main.html +0 -0
  87. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/pyproject.toml +0 -0
  88. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/scripts/make_logos.py +0 -0
  89. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/scripts/record_demo.py +0 -0
  90. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/scripts/social-preview.html +0 -0
  91. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/__main__.py +0 -0
  92. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/acp.py +0 -0
  93. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/action.py +0 -0
  94. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/agent_checks.py +0 -0
  95. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/agent_context.py +0 -0
  96. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/agent_prompt.py +0 -0
  97. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/agent_sessions.py +0 -0
  98. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/assistant.py +0 -0
  99. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/bench_backend.py +0 -0
  100. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/bench_budgets.py +0 -0
  101. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/bench_checks.py +0 -0
  102. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/bench_dedupe.py +0 -0
  103. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/bench_flaky.py +0 -0
  104. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/bench_logsum.py +0 -0
  105. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/bench_quick.py +0 -0
  106. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/bench_quotes.py +0 -0
  107. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/bench_runtime.py +0 -0
  108. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/catalog.py +0 -0
  109. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/checkpoints.py +0 -0
  110. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/cli_args.py +0 -0
  111. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/clipboard.py +0 -0
  112. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/clips.py +0 -0
  113. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/cloud.py +0 -0
  114. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/codesearch.py +0 -0
  115. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/comfy.py +0 -0
  116. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/context.py +0 -0
  117. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/edits.py +0 -0
  118. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/escalate.py +0 -0
  119. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/extensions.py +0 -0
  120. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/film.py +0 -0
  121. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/frontmatter.py +0 -0
  122. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/gitflow.py +0 -0
  123. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/harbor.py +0 -0
  124. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/harbor_bench.py +0 -0
  125. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/hardware.py +0 -0
  126. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/hooks.py +0 -0
  127. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/imageopts.py +0 -0
  128. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/jobs.py +0 -0
  129. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/limits.py +0 -0
  130. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/lsp.py +0 -0
  131. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/manual.py +0 -0
  132. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/matching.py +0 -0
  133. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/mcp/__init__.py +0 -0
  134. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/mcp/auth.py +0 -0
  135. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/mcp/catalog.py +0 -0
  136. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/mcp/catalog.toml +0 -0
  137. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/mcp/client.py +0 -0
  138. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/mcp/commands.py +0 -0
  139. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/mcp/config.py +0 -0
  140. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/mcp/http.py +0 -0
  141. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/mcp/manager.py +0 -0
  142. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/mcp/protocol.py +0 -0
  143. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/mcp/server.py +0 -0
  144. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/mcp/stdio.py +0 -0
  145. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/media.py +0 -0
  146. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/media.toml +0 -0
  147. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/media_catalog.py +0 -0
  148. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/media_cloud.py +0 -0
  149. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/media_video.py +0 -0
  150. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/memory.py +0 -0
  151. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/models.toml +0 -0
  152. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/modes.py +0 -0
  153. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/notify.py +0 -0
  154. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/permissions.py +0 -0
  155. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/planning.py +0 -0
  156. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/preview.py +0 -0
  157. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/qt_hook.py +0 -0
  158. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/render.py +0 -0
  159. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/repeats.py +0 -0
  160. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/repl_history.py +0 -0
  161. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/repl_media.py +0 -0
  162. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/repl_models.py +0 -0
  163. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/repl_sessions.py +0 -0
  164. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/repoid.py +0 -0
  165. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/repomap.py +0 -0
  166. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/review.py +0 -0
  167. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/sandbox.py +0 -0
  168. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/screenshots.py +0 -0
  169. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/screenshots_web.py +0 -0
  170. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/secretscan.py +0 -0
  171. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/servers/__init__.py +0 -0
  172. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/servers/encord.py +0 -0
  173. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/servers/valohai.py +0 -0
  174. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/servers/xai.py +0 -0
  175. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/sessions.py +0 -0
  176. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/steer.py +0 -0
  177. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/tool_helpers.py +0 -0
  178. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/tool_schemas.py +0 -0
  179. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/tools.py +0 -0
  180. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/tools_base.py +0 -0
  181. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/tools_edit.py +0 -0
  182. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/tools_shell.py +0 -0
  183. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/trace_export.py +0 -0
  184. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/trace_view.py +0 -0
  185. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/unreachable.py +0 -0
  186. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/update.py +0 -0
  187. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/vision.py +0 -0
  188. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/web.py +0 -0
  189. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/workflows/__init__.py +0 -0
  190. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/workflows/flux2-klein-4b-t2i.json +0 -0
  191. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/workflows/remove-background.json +0 -0
  192. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/workflows/smooth-film.json +0 -0
  193. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/workflows/sound-stable-audio.json +0 -0
  194. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/workflows/upscale-esrgan.json +0 -0
  195. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/workflows/upscale-video-esrgan.json +0 -0
  196. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/workflows/wan21-fun-camera.json +0 -0
  197. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/workflows/wan21-vace.json +0 -0
  198. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/workflows/wan22-fun-inp-5b.json +0 -0
  199. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/workflows/wan22-ti2v-5b.json +0 -0
  200. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/src/lcode/workflows/z-image-turbo-t2i.json +0 -0
  201. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/comfy_standin.py +0 -0
  202. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/conftest.py +0 -0
  203. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/fake_lsp_server.py +0 -0
  204. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/fake_mcp_server.py +0 -0
  205. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_acp.py +0 -0
  206. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_action.py +0 -0
  207. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_agent.py +0 -0
  208. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_assistant.py +0 -0
  209. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_backends.py +0 -0
  210. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_bench_work.py +0 -0
  211. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_catalog.py +0 -0
  212. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_checkpoints.py +0 -0
  213. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_cli.py +0 -0
  214. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_clipboard.py +0 -0
  215. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_cloud.py +0 -0
  216. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_codesearch.py +0 -0
  217. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_comfy.py +0 -0
  218. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_config.py +0 -0
  219. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_context.py +0 -0
  220. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_context_picker.py +0 -0
  221. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_conversations.py +0 -0
  222. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_escalate.py +0 -0
  223. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_extensions.py +0 -0
  224. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_film.py +0 -0
  225. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_gitflow.py +0 -0
  226. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_gpu_handover.py +0 -0
  227. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_harbor_bench.py +0 -0
  228. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_hooks.py +0 -0
  229. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_image_edit.py +0 -0
  230. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_image_generate.py +0 -0
  231. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_jobs.py +0 -0
  232. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_long_clips.py +0 -0
  233. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_look.py +0 -0
  234. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_lsp.py +0 -0
  235. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_manual.py +0 -0
  236. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_matching.py +0 -0
  237. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_mcp.py +0 -0
  238. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_media_catalog.py +0 -0
  239. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_media_cloud.py +0 -0
  240. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_memory.py +0 -0
  241. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_model_picker.py +0 -0
  242. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_permissions.py +0 -0
  243. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_plan_mode.py +0 -0
  244. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_repeats.py +0 -0
  245. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_repomap.py +0 -0
  246. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_review.py +0 -0
  247. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_robustness.py +0 -0
  248. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_sandbox.py +0 -0
  249. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_screenshots.py +0 -0
  250. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_secretscan.py +0 -0
  251. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_servers.py +0 -0
  252. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_sessions.py +0 -0
  253. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_steer.py +0 -0
  254. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_subagents.py +0 -0
  255. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_tools.py +0 -0
  256. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_update.py +0 -0
  257. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_video.py +0 -0
  258. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_vision.py +0 -0
  259. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_web.py +0 -0
  260. {lcode_cli-0.62.0 → lcode_cli-0.63.0}/tests/test_xai.py +0 -0
@@ -6,6 +6,58 @@ All notable changes to lcode are documented here. The format follows
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.63.0] - 2026-11-11
10
+
11
+ ### Changed
12
+
13
+ - **A reply that thinks at length without acting is stopped.** Sometimes the model weighs one option
14
+ after another for minutes without trying any: in `polyglot-rust-c` it wrote 45,000 to 53,000 tokens,
15
+ most of them thinking, and ran 1 or 2 commands in 15 minutes. Now, when a reply has thought for 7,000 tokens without
16
+ writing anything or calling a tool, lcode stops it and asks for the next step with thinking off. It
17
+ hands the model the last part of its thinking, so it can act on where its reasoning got to. On the
18
+ dev slice, about 1 reply in 100 thought that long: they came from 42 of the 110 attempts that failed
19
+ and 2 of the 102 that passed. Set the budget with `lcode config set think_budget`, `0` for no limit
20
+ ([#241](https://github.com/nasser1941/lcode/issues/241)).
21
+
22
+ ### Fixed
23
+
24
+ - **`lcode -p` exits with `1` when the request fails, also without `--output`.** It showed the error (a
25
+ model error, Ollama stopping in the middle of a reply, running out of memory) and exited with `0`, so in
26
+ `lcode -p "…" && next-step` the next step ran after a failed request. It now exits with the codes
27
+ `--output json` uses: `1` for an error, `3` stopped at `--max-steps`, `4` stopped because the model kept
28
+ repeating itself, `130` interrupted. What it prints is the same, and the interactive session still carries
29
+ on after an error.
30
+ - **The line after a load counts the part of the model in system RAM.** With Ollama 0.40, `qwen3.6-35b`
31
+ at 32K on a 12 GB GPU showed as `10.5 GB, 98% on the GPU and the rest in system RAM`, because Ollama
32
+ leaves out the ~12 GB of experts that stay mapped from the model's file. For the models in the catalog,
33
+ lcode now counts the whole model at its estimate, the one `lcode setup` and `lcode doctor` show:
34
+ `~23 GB, 42% on the GPU and the rest in system RAM`. With Ollama's numbers, the warning that another
35
+ program is using GPU memory couldn't fire. Now it does, and it says how much of the model fits on the GPU.
36
+ - **`lcode doctor` shows the loaded model.** It looked for `lcode-qwen3.6-35b` while Ollama lists it as
37
+ `lcode-qwen3.6-35b:latest`, so the `Loaded` line never appeared for the models `lcode setup` creates.
38
+ It now says how the model fits, in the same words as the line after a load.
39
+ - **`lcode bench` counts the part of the model in system RAM, too.** For `qwen3.6-35b` at 32K on a
40
+ 12 GB GPU, it said `10.4 GB, 98% on the GPU` after loading, and the same in its summary. It now says
41
+ `~23 GB, 42% on the GPU and the rest in system RAM`, as the line after a load does. `--json` results
42
+ keep Ollama's count in `memory_gb` and `gpu_percent`, so they still compare with older results, and
43
+ add lcode's estimate in `estimated_memory_gib` and `estimated_gpu_percent`.
44
+ - **A passing run of one test file counted as the whole checks.** When the model ran the project's
45
+ check command with a path or a test name after it (`.venv/bin/python -m pytest -q tests/test_calc.py`),
46
+ lcode took the checks as passed and didn't run them, and `/status` and `lcode -p --output json` said
47
+ they passed, even on a project whose full run stops before its first test. Now a run like that, or
48
+ one with an option that picks tests (`-k`, `--ignore`, `npm test -- --grep`), doesn't count, and lcode
49
+ runs the checks itself. Options alone, like `-x` or `--tb=short`, still count. In 426 attempts on six
50
+ dev-slice nights this changes 2: one now runs xarray's suite (4.4 minutes, failing on tests that failed
51
+ before), the other a run that stops before its first test in under a second.
52
+ - **A model server that stops in the middle of a reply no longer ends lcode in a traceback.** When the
53
+ connection broke while a reply streamed, as it did when `lcode update` replaced Ollama's container during
54
+ a reply, `lcode` and `lcode -p` stopped with a Python traceback, which also ended an interactive
55
+ session. Now lcode says that Ollama stopped in the middle of a reply and what to do, the session carries
56
+ on, the trace records the failure, and `lcode -p --output json` reports `status` `error`. LM Studio,
57
+ llama-server, vLLM and MLX servers get the same. A reply stopped on purpose breaks its connection too,
58
+ and that stays a stop: a cancel from an editor (ACP) came back as an internal error,
59
+ `ChunkedEncodingError`, and a subagent stopped with Ctrl+C was reported as failed.
60
+
9
61
  ## [0.62.0] - 2026-11-06
10
62
 
11
63
  ### Changed
@@ -1367,7 +1419,8 @@ First public release.
1367
1419
  - `AGENTS.md` project instructions and `/init` to generate them.
1368
1420
  - One-line installer for Linux and macOS.
1369
1421
 
1370
- [Unreleased]: https://github.com/nasser1941/lcode/compare/v0.62.0...HEAD
1422
+ [Unreleased]: https://github.com/nasser1941/lcode/compare/v0.63.0...HEAD
1423
+ [0.63.0]: https://github.com/nasser1941/lcode/compare/v0.62.0...v0.63.0
1371
1424
  [0.62.0]: https://github.com/nasser1941/lcode/compare/v0.61.0...v0.62.0
1372
1425
  [0.61.0]: https://github.com/nasser1941/lcode/compare/v0.60.0...v0.61.0
1373
1426
  [0.60.0]: https://github.com/nasser1941/lcode/compare/v0.59.0...v0.60.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: lcode-cli
3
- Version: 0.62.0
3
+ Version: 0.63.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/
@@ -25,6 +25,8 @@ lcode -p "Explain the retry logic" --output stream-json --max-steps 20
25
25
  lcode's usual output goes to stderr, so stdout holds only the JSON. The exit code says how it
26
26
  went: `0` success, `1` an error, `3` stopped at `--max-steps`, `4` stopped because the model
27
27
  [kept repeating itself](how-it-works.md#when-the-model-repeats-itself), `130` interrupted.
28
+ Without `--output`, `lcode -p` exits with the same codes, so in `lcode -p "…" && next-step`
29
+ the next step runs only after a request that succeeded.
28
30
 
29
31
  ### The result
30
32
 
@@ -25,7 +25,7 @@ its memory use, so those columns stay empty.
25
25
  lcode bench · NVIDIA GeForce RTX 4080 Laptop GPU (12 GB VRAM), 31 GB RAM · Ollama 0.40.13
26
26
 
27
27
  lcode-qwen3.6-35b · 32K context · reasoning on · 8 tasks · 3 attempts each
28
- Loaded in 18s · 10.4 GB, 98% on the GPU · reads prompts at 905 tok/s
28
+ Loaded in 18s · ~23 GB, 42% on the GPU and the rest in system RAM · reads prompts at 905 tok/s
29
29
  Attempt 1 of 3
30
30
  ✓ fix-bug Fix a bug so the tests pass 22s the tests pass
31
31
  ✓ find-code Answer with file:line 8s next_wait at backoff.py:13
@@ -182,7 +182,7 @@ quick tasks once, as `lcode bench` did before 0.57.
182
182
  | **Generation** | Output tokens per second, across all the model's responses |
183
183
  | **Prompt reading** | Prompt tokens per second: how fast the model reads files and tool output. Measured per model with fresh 4,000-token prompts (the faster of two readings, since the first one after loading includes warm-up), because during the tasks Ollama serves most of each request from its prompt cache |
184
184
  | **Tool-call errors** | Tool calls that failed (wrong arguments, editing without reading first, unmatched edits) or that the model wrote as invalid JSON |
185
- | **Memory** | The model's memory use and how much of it is on the GPU, from Ollama |
185
+ | **Memory** | The model's memory and how much of it is on the GPU, counted as in the [line after a load](usage.md#whats-happening-under-the-hood). Ollama leaves out what stays mapped from the model's file in system RAM, so for a model in `lcode models` that's partly off the GPU, it's lcode's estimate of the whole model (`~23 GB`). Otherwise it's what Ollama says |
186
186
 
187
187
  Results depend on the context window, so `lcode bench` uses **32K** by default on every machine,
188
188
  which makes results comparable. When comparing models, each one is unloaded before the next starts
@@ -217,7 +217,7 @@ RTX 4080 Laptop GPU (12 GB) with 31 GB of RAM, Ollama 0.40.13, 32K context, reas
217
217
  | Generation | 64.0 tok/s |
218
218
  | Prompt reading | 851 tok/s |
219
219
  | Tool-call errors | 4 |
220
- | Memory | 10.5 GB, 98% on GPU |
220
+ | Memory | ~23 GB, 42% on GPU |
221
221
 
222
222
  What it missed:
223
223
  - one `spec-fix` attempt fixed the reported case but not all the docstring's rules;
@@ -226,6 +226,9 @@ What it missed:
226
226
  - every `runtime-bug` attempt settled for a band-aid: the window still grew, or still couldn't be
227
227
  made smaller.
228
228
 
229
+ The table shows memory as lcode counts it now. lcode 0.58.0 printed Ollama's count,
230
+ `10.5 GB, 98% on GPU`, which leaves out the ~12 GB of experts in system RAM.
231
+
229
232
  Two `wide-feature` attempts were first counted as failed. Their `budget list` printed `No budgets
230
233
  set.` without budgets, and one listed the budgeted categories first. The task asks for neither
231
234
  behavior, so the check now accepts both (0.59.0), and the table counts them as passed.
@@ -302,6 +305,8 @@ existing fields keep their meaning until `schema` changes.
302
305
  "prompt_tps": 904.6,
303
306
  "memory_gb": 10.4,
304
307
  "gpu_percent": 98,
308
+ "estimated_memory_gib": 22.7,
309
+ "estimated_gpu_percent": 42,
305
310
  "attempts": 3,
306
311
  "passed": 24,
307
312
  "total": 24,
@@ -328,7 +333,8 @@ existing fields keep their meaning until `schema` changes.
328
333
  | `ollama`, `server` | The Ollama version, or `null` with [another model server](servers.md); `server` names the server either way |
329
334
  | `runs[].model` | The name you gave (catalog key or Ollama tag); `ollama_model` is the model that ran |
330
335
  | `runs[].context`, `num_batch`, `think` | The settings used. lcode lowers the batch size or context if the GPU runs out of memory, and reports what it ended up using |
331
- | `runs[].memory_gb`, `gpu_percent` | From Ollama's `/api/ps`; `null` if unavailable |
336
+ | `runs[].memory_gb`, `gpu_percent` | The model's memory in GB and the share of it on the GPU, as Ollama's `/api/ps` counts them; `null` if unavailable. Ollama 0.40 leaves out what stays mapped from the model's file in system RAM: `qwen3.6-35b` at 32K on a 12 GB GPU shows as 10.4 GB, 98% of it on the GPU |
337
+ | `runs[].estimated_memory_gib`, `estimated_gpu_percent` | When Ollama's count leaves out part of a model in `lcode models`: lcode's estimate of the whole model in GiB, and the share of it on the GPU, as the summary shows them (`~23 GB, 42% on GPU`). `null` when Ollama counts the whole model (all of it on the GPU, or a model outside the catalog) and in older results |
332
338
  | `runs[].generation_tps` | Output tokens per second across the tasks; `null` if Ollama reported no timings |
333
339
  | `runs[].prompt_tps` | Prompt tokens per second for a fresh 4,000-token prompt (the faster of two readings); `null` if it couldn't be measured |
334
340
  | `runs[].usage` | Totals over the tasks as Ollama reports them. `prompt_tokens` includes tokens served from the prompt cache |
@@ -59,6 +59,7 @@ lcode config path # print the file location
59
59
  | `escalate_url` | — | Its server, when it isn't the provider's usual one: another Ollama, or any OpenAI-compatible API |
60
60
  | `escalate_price` | — | Its price in dollars per million tokens, input/output (e.g. `3/15`), for the cost shown before each use |
61
61
  | `repeat_limit` | `3` | Identical tool calls with identical results before lcode [steps in](how-it-works.md#when-the-model-repeats-itself); `0` turns it off, along with the checks for [unreachable sites](how-it-works.md#when-a-site-cant-be-reached) and [thinking in circles](how-it-works.md#when-a-reply-goes-nowhere) |
62
+ | `think_budget` | `7000` | Tokens a reply may [think](how-it-works.md#when-a-reply-goes-nowhere) before it writes anything or calls a tool. Past that, lcode stops the reply and asks for the next step with thinking off; `0` means no limit |
62
63
  | `secret_check` | `true` | Before `git commit` and `git push`, look for passwords, keys and tokens they'd add ([details](usage.md#secrets-in-commits)) |
63
64
  | `checkpoints` | `true` | Save a checkpoint before the model changes files, so [`/undo`](usage.md#undo-and-checkpoints) can restore them |
64
65
  | `trace` | `true` | Record each request's model calls, tool calls, times and tokens on this machine, for [`lcode trace`](traces.md) (kept 30 days) |
@@ -94,6 +94,17 @@ four in one request, lcode stops it (status `loop`), offering the
94
94
  [stronger model](usage.md#a-stronger-model-when-stuck) first when one is set. An answer the context
95
95
  cut off midway is kept, with a warning to `/compact` or use a larger `/context`.
96
96
 
97
+ A reply can also think for a long time without repeating itself: weighing one option after another,
98
+ never trying any. When a reply has thought for 7,000 tokens (`think_budget`) and hasn't yet written
99
+ anything or called a tool, lcode stops it the same way. The model gets back the last part of its
100
+ thinking, so it can act on where its reasoning got to, and the next reply runs with thinking off.
101
+ Once the model acts, thinking is back on. On the dev slice of the
102
+ [public benchmarks](public-benchmarks.md), about 1 reply in 100 thought that long. They came from 42
103
+ of the 110 attempts that failed and 2 of the 102 that passed. Such a reply doesn't count towards the
104
+ four per request, so a long task with several hard steps carries on, but a reply that goes nowhere
105
+ right after one stops the request as before. Change the budget with
106
+ `lcode config set think_budget 12000`, or turn it off with `0`.
107
+
97
108
  ## Subagents
98
109
 
99
110
  The `agent` tool starts a [subagent](agents.md): another agent loop with its own conversation, the
@@ -181,6 +181,9 @@ lcode update --check # only show which versions are out
181
181
  network and restart policy. The old one is kept until the new one answers with the new
182
182
  version, and is put back if it doesn't.
183
183
  - Your models stay: they're in the container's volume.
184
+ - A reply that an lcode session is getting while the container is replaced stops halfway. That
185
+ session [says so](troubleshooting.md#ollama-stopped-in-the-middle-of-a-reply) and carries on:
186
+ send the request again after the update.
184
187
  - **Ollama installed without Docker** gets the command that updates it: on Linux,
185
188
  `curl -fsSL https://ollama.com/install.sh | sh`; on macOS, `brew upgrade ollama` or the app
186
189
  itself.
@@ -258,7 +258,8 @@ RAM needed ≈ memory − GPU memory + ~10 GB for Ollama's server and prompt cac
258
258
 
259
259
  - **The part of the model that doesn't fit on the GPU.** A Mixture-of-Experts model's experts stay
260
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.
261
+ it shows `qwen3.6-35b` at 32K as 10.5 GB, with ~12 GB more in RAM. lcode counts them: after a load,
262
+ in `lcode doctor` and in `lcode bench`, it says `~23 GB, 42% on the GPU and the rest in system RAM`.
262
263
  - **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
 
264
265
  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,
@@ -12,7 +12,7 @@ lcode
12
12
 
13
13
  ```text
14
14
  ╭──────────────────────────────────────────────╮
15
- │ lcode v0.62.0 — local coding agent │
15
+ │ lcode v0.63.0 — local coding agent │
16
16
  │ │
17
17
  │ model lcode-qwen3.6-35b │
18
18
  │ context 256K tokens │
@@ -23,6 +23,16 @@ Ollama isn't running (or isn't installed).
23
23
  as well (`docker volume prune -a`), so were the models: download them again with `lcode setup`.
24
24
  - Remote server: `lcode config set ollama_host http://host:11434`.
25
25
 
26
+ ### `Ollama stopped in the middle of a reply`
27
+
28
+ The connection to Ollama broke while the model was answering: Ollama stopped or restarted (a crash, or an
29
+ update that replaces its container, as `lcode update` does), or the network to a remote Ollama dropped.
30
+ The session carries on and keeps the conversation, without the reply that was cut off. Once Ollama is
31
+ running, send the request again. If it doesn't answer, `lcode doctor` checks it and says how to start it.
32
+
33
+ With `lcode -p --output json`, the result has `status` `error` with this message, and lcode exits with
34
+ `1`. LM Studio, llama-server, vLLM and MLX servers get the same message, with their own name.
35
+
26
36
  ### Docker: `all predefined address pools have been fully subnetted`
27
37
 
28
38
  Docker Compose can't create a network for the Ollama container. A VPN that routes all traffic (for example
@@ -84,8 +94,10 @@ need `lcode mcp login <name>`. More in [MCP servers: Troubleshooting](mcp.md#tro
84
94
  starts, and `keep_alive` keeps it loaded between requests.
85
95
  - Reading many large files takes a while the first time (~280 tokens/s on a 12 GB GPU, ~500 with
86
96
  `lcode config set num_batch 1024` if it fits); follow-up turns reuse the cache.
87
- - `ollama ps` shows how much of the model is on the GPU. Dense models are much slower when split;
88
- prefer the MoE models in `lcode models` on smaller GPUs.
97
+ - `lcode doctor` shows how much of the loaded model is on the GPU, for example
98
+ `Loaded ~23 GB, 42% on the GPU and the rest in system RAM · 32K context`. `ollama ps` leaves out the
99
+ part of a Mixture-of-Experts model that's in system RAM, so it can say 98%. Dense models are much
100
+ slower when split; prefer the MoE models in `lcode models` on smaller GPUs.
89
101
  - `--no-think` skips reasoning for simple requests.
90
102
 
91
103
  ### It starts fast, then gets about three times slower
@@ -234,7 +234,10 @@ runs the project's checks itself before the answer is final:
234
234
  whether its change works. A suite that's simply this slow needs a faster command (below).
235
235
  - **When the model already ran them** after its last change and they passed, they aren't run again.
236
236
  A run piped into another program (`pytest -q | tail`) exits with that program's code, so it counts
237
- only if its output shows a test summary with nothing failing.
237
+ only if its output shows a test summary with nothing failing. A run of part of them doesn't count:
238
+ one with a path or a test name after the check's command (`pytest -q tests/test_calc.py`), or an
239
+ option that picks tests (`-k`, `--ignore`, `npm test -- --grep`). Options alone, like `-x` or
240
+ `--tb=short`, still count.
238
241
  - **Where they run:** in the project's root, wherever the model's shell went last. A command from your
239
242
  own `checks` setting runs in the folder you started lcode in.
240
243
  - **Permission:** they run like any other command, so in `ask` mode the first run asks (++a++ allows
@@ -409,7 +412,7 @@ stays loaded:
409
412
 
410
413
  | When | What it says |
411
414
  |---|---|
412
- | The model was loaded | `◆ Loaded qwen3.6-35b in 15s: 22.3 GB, 45% on the GPU and the rest in system RAM.`, and a warning when less of it is on the GPU than usual, because another program or model is using GPU memory |
415
+ | The model was loaded | `◆ Loaded qwen3.6-35b in 15s: ~23 GB, 42% on the GPU and the rest in system RAM.`, and a warning when less of it is on the GPU than usual, because another program or model is using GPU memory |
413
416
  | A dense model doesn't fit on the GPU (at startup and on `/model`) | `⚠ qwen3.8-27b is a dense model: all 27B parameters work on every token. It's capable, but slow here. Only about 61% of it fits in the 12 GB of GPU memory…`, with what to do instead |
414
417
  | 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 …)` |
415
418
  | 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.` |
@@ -421,6 +424,12 @@ While the model loads in the background at startup, the status bar says
421
424
  part of them in system RAM. Dense ones slow down a lot, to a few tokens a second, which is why they
422
425
  get the warning.
423
426
 
427
+ The `~` marks lcode's estimate of the model's memory, the same one `lcode setup` and `lcode doctor`
428
+ show. Ollama leaves out what stays mapped from the model's file in system RAM: `ollama ps` shows
429
+ qwen3.6-35b at 32K on a 12 GB GPU as 10.5 GB, 98% of it on the GPU, while ~12 GB of its experts are
430
+ in RAM. So when part of a model in `lcode models` is off the GPU, lcode counts all of it. For other
431
+ models it repeats what Ollama says. `lcode doctor` shows the same line for the model in memory.
432
+
424
433
  ## Steer while it works
425
434
 
426
435
  A request can take minutes with a local model. You don't have to stop it to change course: type
@@ -822,4 +831,7 @@ lcode -p "Review the uncommitted changes (git diff) for bugs"
822
831
  lcode -p "Run the tests and fix any failures" --auto-edit
823
832
  ```
824
833
 
834
+ The exit code says how the request went: `0` when it succeeded, `1` for an error, and the other
835
+ codes in [Automation](automation.md#structured-output).
836
+
825
837
  Combine with `--yolo` only in disposable environments.
@@ -3,7 +3,7 @@
3
3
  From a program: `from lcode import Session` (see lcode.api).
4
4
  """
5
5
 
6
- __version__ = "0.62.0"
6
+ __version__ = "0.63.0"
7
7
 
8
8
  API = ("Session", "Result", "Options", "SetupError")
9
9
 
@@ -44,27 +44,47 @@ if TYPE_CHECKING:
44
44
 
45
45
  MAX_STALLS = 2 # replies in a row that go round in circles or say nothing, before lcode stops the request
46
46
  MAX_STALLS_PER_REQUEST = 4 # such replies in one request, even with work in between
47
+ THOUGHT_TAIL = 1500 # characters of a stopped reply's thinking that the model gets back, so it needn't start over
47
48
  STALLED = {
48
49
  "circles": "the reply went round in circles, so lcode stopped it",
50
+ "overthought": "the reply thought at length without acting, so lcode stopped it",
49
51
  "cut_off": "the reply filled the context before it said anything",
50
52
  "": "the reply was empty",
51
53
  }
52
54
 
53
55
 
54
- def stall_note(trouble: str, thinking_off: bool = False) -> str:
55
- """What the model is told after a reply that went round in circles or ended without a word."""
56
+ def stall_note(trouble: str, thinking_off: bool = False, thought: str = "") -> str:
57
+ """What the model is told after a reply that went round in circles, thought too long or ended without a word.
58
+
59
+ `thought` is the stopped reply's thinking: for one that thought too long, its end goes back to the model, so
60
+ the next reply can act on where the reasoning got to instead of starting it over (#241)."""
56
61
  first = {
57
62
  "circles": "Your last reply went round in circles (the same thoughts over and over), so lcode stopped it.",
63
+ "overthought": "Your last reply thought at length without writing anything or making a tool call, so lcode "
64
+ "stopped it.",
58
65
  "cut_off": "Your last reply filled the rest of the context before you said anything.",
59
66
  "": "Your last reply was empty.",
60
67
  }[trouble]
61
68
  off = ": thinking is off for this reply" if thinking_off else ""
62
- return (
69
+ note = (
63
70
  f"[lcode] {first} Don't deliberate at length now{off}. Either make your next tool call, or, if you're stuck, "
64
71
  "tell the user in a few lines what you did, what fails, and what they could do. If you were about to check "
65
72
  "something by running it, run it now instead of reasoning about it: for a window, take a screenshot (with "
66
73
  "actions for clicks or keys)."
67
74
  )
75
+ if trouble == "overthought" and thought.strip():
76
+ note += f"\n\nWhere your thinking had got to (its last part):\n\n{thought_tail(thought)}"
77
+ return note
78
+
79
+
80
+ def thought_tail(thought: str) -> str:
81
+ """The end of a stopped reply's thinking, from a line or sentence start: about THOUGHT_TAIL characters."""
82
+ if len(thought) <= THOUGHT_TAIL:
83
+ return thought.strip()
84
+ tail = thought[-THOUGHT_TAIL:]
85
+ ends = [tail.find(end) + len(end) for end in ("\n", ". ", "? ", "! ", "… ") if end in tail]
86
+ starts = [i for i in ends if i < len(tail) // 2] or [tail.find(" ") + 1] # else at least a whole word
87
+ return "…" + tail[min(starts) :].strip()
68
88
 
69
89
 
70
90
  EVENT_OUTPUT = 4000 # characters of a tool's output in an event
@@ -343,7 +363,9 @@ class Agent(PromptParts, Sessions, Checks, ContextWindow, ModelCalls):
343
363
  continue
344
364
  if not calls and (self.reply_trouble == "circles" or not (reply.get("content") or "").strip()):
345
365
  stalls += 1
346
- stalled += 1
366
+ # A reply that only thought too long counts as one in a row, so one that goes nowhere after it ends
367
+ # the request, but not towards the limit per request: in a long task, hard steps think long.
368
+ stalled += self.reply_trouble != "overthought"
347
369
  dropped = self.messages.pop() # no answer, and circles would only fill the context
348
370
  kept = self.keep_dropped(dropped)
349
371
  if stalls < MAX_STALLS and stalled < MAX_STALLS_PER_REQUEST:
@@ -351,10 +373,14 @@ class Agent(PromptParts, Sessions, Checks, ContextWindow, ModelCalls):
351
373
  # the same deliberation over (all 6 polyglot-rust-c attempts on the dev slice, #241).
352
374
  pause = self.settings.think and self.can_skip_thinking()
353
375
  off = ", with thinking off" if pause else ""
354
- self.console.print(
355
- Text(f" ⎿ {STALLED[self.reply_trouble]}: asking for a short answer{off}{kept}", style="yellow")
356
- )
357
- note = stall_note(self.reply_trouble, thinking_off=pause)
376
+ what = STALLED[self.reply_trouble]
377
+ if self.reply_trouble == "overthought":
378
+ what = (
379
+ f"the reply thought for over {format_tokens(self.settings.think_budget)} tokens without "
380
+ "acting (think_budget), so lcode stopped it"
381
+ )
382
+ self.console.print(Text(f" ⎿ {what}: asking for a short answer{off}{kept}", style="yellow"))
383
+ note = stall_note(self.reply_trouble, thinking_off=pause, thought=dropped.get("thinking") or "")
358
384
  self.messages.append({"role": "user", "content": note})
359
385
  continue
360
386
  times = "twice in a row" if stalls >= MAX_STALLS else f"{stalled} times in this request"
@@ -86,6 +86,7 @@ class Settings:
86
86
  secret_check: bool = True # scan what git commit and git push would add (lcode.secretscan)
87
87
  compact_at: int = 0 # tokens: make room at this size even when the window is larger (0: only at 85%)
88
88
  repeat_limit: int = 3 # identical calls with identical results before the model is told (lcode.repeats)
89
+ think_budget: int = 7000 # tokens a reply may think before it writes or calls a tool (0: no limit)
89
90
  checks: str = "off" # the project's checks after a change (lcode.checks): auto, off or a command
90
91
  review: str = "off" # check a change against the request before the answer (lcode.review): auto or off
91
92
  escalate_model: str | None = None # a stronger model to ask when stuck (lcode.escalate): provider/model
@@ -191,7 +192,7 @@ class AgentBase:
191
192
  self.turn_status = "" # how the last request ended: success, max_steps, loop, blocked
192
193
  self.repeats = Repeats(settings.repeat_limit) # notices when the model repeats itself
193
194
  self.sites = Sites(NOTE_AT if settings.repeat_limit else 0) # notices a site this machine can't reach
194
- self.reply_trouble = "" # what went wrong with the last reply: "circles", "cut_off" or ""
195
+ self.reply_trouble = "" # what went wrong with the last reply: "circles", "overthought", "cut_off" or ""
195
196
  self.response = None # the streaming response, so another thread can abort it
196
197
  self.ctx_used = 0
197
198
  self._repo: tuple[Path, repoid.Repo | None] | None = None # the workspace's repository, for saved sessions
@@ -41,6 +41,8 @@ GPU_MEMORY_ERRORS = (
41
41
 
42
42
 
43
43
  SAFE_NUM_BATCH = 512 # Ollama's default prompt batch
44
+ # Characters a thinking token takes: qwen3.6's long thinking on the dev slice, as Ollama counted it (median 3.3).
45
+ THINK_CHARS_PER_TOKEN = 3.3
44
46
 
45
47
 
46
48
  class Progress:
@@ -229,7 +231,11 @@ class ModelCalls(AgentBase):
229
231
  """Stream one model response, rendering thinking/content live. Returns the assistant message.
230
232
 
231
233
  `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."""
234
+ round in circles, so the model acts instead of starting the same deliberation over.
235
+
236
+ A reply that thinks past `think_budget` tokens before it writes anything or calls a tool is stopped
237
+ (`reply_trouble` "overthought"): on the dev slice, 2 of 102 attempts that passed had one, against 42 of 110
238
+ that failed (#241)."""
233
239
  content, thinking, tool_calls, final = "", "", [], {}
234
240
  md = MarkdownStreamer(self.console)
235
241
  progress = Progress(steering=self.steering)
@@ -251,6 +257,7 @@ class ModelCalls(AgentBase):
251
257
 
252
258
  start_spinner()
253
259
  circles = Circles()
260
+ budget = self.settings.think_budget * THINK_CHARS_PER_TOKEN
254
261
  self.reply_trouble = ""
255
262
  stream = self.chat(self.messages, self.tool_schemas(), self.settings.think and think)
256
263
  try:
@@ -273,6 +280,10 @@ class ModelCalls(AgentBase):
273
280
  if self.settings.repeat_limit and circles.feed(msg["thinking"]):
274
281
  self.reply_trouble = "circles"
275
282
  break # closing the stream below stops the model
283
+ acted = content.strip() or (msg.get("content") or "").strip() or tool_calls or msg.get("tool_calls")
284
+ if budget and len(thinking) > budget and not acted:
285
+ self.reply_trouble = "overthought"
286
+ break
276
287
  if msg.get("content"):
277
288
  if printed_thinking:
278
289
  self.console.print("\n")
@@ -266,6 +266,7 @@ def open_agent(cwd: Path, options: Options, console: Console, hw: Hardware | Non
266
266
  notify_after=cfg["notify_after"],
267
267
  secret_check=cfg["secret_check"],
268
268
  repeat_limit=cfg["repeat_limit"],
269
+ think_budget=cfg["think_budget"],
269
270
  checks=cfg["checks"],
270
271
  review=cfg["review"],
271
272
  escalate_model=cfg["escalate_model"],
@@ -345,6 +346,12 @@ def close_agent(agent: Agent) -> None:
345
346
  # ----------------------------------------------------------------------------- running
346
347
 
347
348
 
349
+ def request_status(agent: Agent) -> str:
350
+ """How a request that ran to its end went: success, or max_steps, loop or blocked when lcode stopped it. `lcode -p`
351
+ exits with its code (EXIT_CODES), with or without --output."""
352
+ return agent.turn_status if agent.turn_status in ("max_steps", "loop", "blocked") else "success"
353
+
354
+
348
355
  def run_request(agent: Agent, prompt: str) -> Result:
349
356
  """Run one request to its end and say how it went; errors end up in the result, not raised."""
350
357
  calls: dict[str, dict] = {}
@@ -369,7 +376,7 @@ def run_request(agent: Agent, prompt: str) -> Result:
369
376
 
370
377
  try:
371
378
  agent.run_turn(prompt)
372
- status = agent.turn_status if agent.turn_status in ("max_steps", "loop", "blocked") else "success"
379
+ status = request_status(agent)
373
380
  except KeyboardInterrupt:
374
381
  status, error = "interrupted", "interrupted before the request was done"
375
382
  except ModelError as e:
@@ -21,7 +21,7 @@ from urllib.parse import quote
21
21
 
22
22
  import requests
23
23
 
24
- from lcode.ollama import OllamaError, redact
24
+ from lcode.ollama import OllamaError, redact, reply_lines
25
25
 
26
26
  PRESETS = { # backend setting -> (the server's name, its default address)
27
27
  "lmstudio": ("LM Studio", "http://localhost:1234/v1"),
@@ -308,7 +308,7 @@ class OpenAICompatible:
308
308
  with r:
309
309
  if r.status_code != 200:
310
310
  raise self._failed(r.status_code, r.text)
311
- for line in r.iter_lines():
311
+ for line in reply_lines(r, self.name, self.host, BackendError):
312
312
  if not line or not line.startswith(b"data:"):
313
313
  continue
314
314
  data = line[5:].strip()
@@ -27,12 +27,12 @@ from rich.markup import escape
27
27
  from rich.table import Table
28
28
  from rich.text import Text
29
29
 
30
- from lcode import __version__, escalate
30
+ from lcode import __version__, escalate, residency
31
31
  from lcode.agent import Agent, Settings
32
32
  from lcode.bench_checks import Check, Task
33
33
  from lcode.bench_quick import TASKS
34
34
  from lcode.config import format_tokens
35
- from lcode.hardware import Hardware
35
+ from lcode.hardware import GIB, Hardware
36
36
  from lcode.ollama import Ollama, OllamaError
37
37
 
38
38
  SCHEMA_VERSION = 1
@@ -188,8 +188,10 @@ class ModelRun:
188
188
  think: bool = True
189
189
  load_seconds: float = 0.0
190
190
  prompt_tps: float | None = None # measured with a fresh prompt; see prompt_speed()
191
- memory_gb: float | None = None
192
- gpu_percent: int | None = None
191
+ memory_gb: float | None = None # as Ollama's /api/ps counts it, which can leave part of the model out
192
+ gpu_percent: int | None = None # of memory_gb, on the GPU
193
+ estimated_memory_gib: float | None = None # all of the model by the catalog's estimate, when Ollama leaves part out
194
+ estimated_gpu_percent: int | None = None # of estimated_memory_gib, on the GPU
193
195
  usage: dict = field(default_factory=dict)
194
196
  tasks: list[TaskResult] = field(default_factory=list)
195
197
  error: str | None = None # the model couldn't run at all
@@ -219,6 +221,14 @@ class ModelRun:
219
221
  def tool_errors(self) -> int:
220
222
  return sum(t.tool_errors for t in self.tasks)
221
223
 
224
+ def note_memory(self, where: residency.Placement) -> None:
225
+ """Ollama's count keeps the names it always had, so results compare with older ones. The estimate that the line
226
+ after the load shows goes next to it."""
227
+ self.memory_gb, self.gpu_percent = round(where.size / 1e9, 1), round(100 * where.vram / where.size)
228
+ if where.estimate > where.size:
229
+ self.estimated_memory_gib = round(where.estimate / GIB, 1)
230
+ self.estimated_gpu_percent = round(100 * where.gpu_share)
231
+
222
232
  def to_json(self) -> dict:
223
233
  data = asdict(self)
224
234
  rates = self.rates()
@@ -410,13 +420,11 @@ def _read_prompt(ollama: Ollama, settings: Settings, options: dict) -> float | N
410
420
  return round(count / (ns / 1e9), 1) if ns and count >= 1000 else None
411
421
 
412
422
 
413
- def memory_use(ollama: Ollama, model: str) -> tuple[float | None, int | None]:
414
- for entry in ollama.running():
415
- if entry.get("name") in (model, f"{model}:latest") or entry.get("model") in (model, f"{model}:latest"):
416
- size, vram = entry.get("size") or 0, entry.get("size_vram") or 0
417
- if size:
418
- return round(size / 1e9, 1), round(100 * vram / size)
419
- return None, None
423
+ def memory_use(ollama: Ollama, model: str, context: int) -> residency.Placement | None:
424
+ """How the loaded model sits in memory, counted as the line after a load counts it: Ollama 0.40 leaves out the
425
+ part of a Mixture-of-Experts model that stays mapped from its file in RAM (see residency.with_estimate)."""
426
+ where = residency.placement(ollama, model) # Ollama lists lcode-qwen3.6-35b as lcode-qwen3.6-35b:latest
427
+ return residency.with_estimate(where, model, context) if where and where.size else None
420
428
 
421
429
 
422
430
  def run_model(
@@ -455,14 +463,15 @@ def run_model(
455
463
  run.interrupted = True
456
464
  return run
457
465
  run.load_seconds = round(time.monotonic() - started, 1)
458
- run.memory_gb, run.gpu_percent = memory_use(ollama, settings.model)
466
+ if placed := memory_use(ollama, settings.model, settings.context):
467
+ run.note_memory(placed)
459
468
  try:
460
469
  with console.status(Elapsed(" Measuring prompt speed")):
461
470
  run.prompt_tps = prompt_speed(ollama, settings, options)
462
471
  except KeyboardInterrupt:
463
472
  run.interrupted = True
464
473
  return run
465
- where = f" · {run.memory_gb} GB, {run.gpu_percent}% on the GPU" if run.memory_gb else ""
474
+ where = f" · {placed.describe()}" if placed else ""
466
475
  reads = f" · reads prompts at {run.prompt_tps:,.0f} tok/s" if run.prompt_tps else ""
467
476
  if getattr(ollama, "kind", "ollama") == "ollama":
468
477
  console.print(f" [dim]Loaded in {run.load_seconds:.0f}s{where}{reads}[/]")
@@ -503,8 +512,8 @@ def run_model(
503
512
  run.pruned, run.compacted = pruned + shared.pruned, compacted + shared.compacted
504
513
  if run.interrupted:
505
514
  break
506
- if run.memory_gb is None:
507
- run.memory_gb, run.gpu_percent = memory_use(ollama, settings.model)
515
+ if run.memory_gb is None and (placed := memory_use(ollama, settings.model, settings.context)):
516
+ run.note_memory(placed)
508
517
  # lcode lowers the batch size or context if the GPU runs out of memory; report what was used.
509
518
  run.context, run.num_batch, run.think = settings.context, settings.num_batch, settings.think
510
519
  return run
@@ -521,6 +530,13 @@ def percent(share: float | None) -> str:
521
530
  return "–" if share is None else f"{share * 100:.0f}%"
522
531
 
523
532
 
533
+ def memory(run: ModelRun) -> str:
534
+ """'~23 GB, 42% on GPU' by lcode's estimate, as the line after the load counts it, or else what Ollama says."""
535
+ if run.estimated_memory_gib:
536
+ return f"~{run.estimated_memory_gib:.0f} GB, {run.estimated_gpu_percent}% on GPU"
537
+ return f"{run.memory_gb} GB, {run.gpu_percent}% on GPU" if run.memory_gb else "?"
538
+
539
+
524
540
  def summary_rows(runs: list[ModelRun], tasks: list[Task]) -> list[tuple[str, list[str]]]:
525
541
  rows = []
526
542
  for task in {t.id: t for t in tasks}.values(): # a task that ran several times: one row, a mark each
@@ -554,10 +570,7 @@ def summary_rows(runs: list[ModelRun], tasks: list[Task]) -> list[tuple[str, lis
554
570
  ("Generation", [cell(r, f"{r.generation_tps:.1f} tok/s" if r.generation_tps else "?") for r in runs]),
555
571
  ("Prompt reading", [cell(r, f"{r.prompt_tps:,.0f} tok/s" if r.prompt_tps else "?") for r in runs]),
556
572
  ("Tool-call errors", [cell(r, str(r.tool_errors)) for r in runs]),
557
- (
558
- "Memory",
559
- [cell(r, f"{r.memory_gb} GB, {r.gpu_percent}% on GPU" if r.memory_gb else "?") for r in runs],
560
- ),
573
+ ("Memory", [cell(r, memory(r)) for r in runs]),
561
574
  ("Context", [cell(r, format_tokens(r.context)) for r in runs]),
562
575
  ]
563
576
  if any(r.session for r in runs):