tether-sdk 0.2.17__tar.gz → 0.2.18__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 (269) hide show
  1. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/AGENTS.md +5 -5
  2. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/PKG-INFO +1 -1
  3. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/docs/reference/agent-interface.md +1 -1
  4. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/docs/reference/tools.md +2 -0
  5. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/docs/release-notes.md +17 -0
  6. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/docs/troubleshooting.md +1 -1
  7. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/docs/tutorial/built-in-tools.md +1 -1
  8. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/docs/tutorial/workflows-and-telemetry.md +1 -1
  9. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/e2e/test_progress.py +16 -2
  10. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/e2e/test_quirks.py +25 -0
  11. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/golden/coding_edit_failure_modes.snap.json +10 -10
  12. tether_sdk-0.2.18/tests/test_edit_only_shell.py +71 -0
  13. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/test_edit_tool.py +14 -0
  14. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/test_progress.py +3 -1
  15. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/test_store.py +6 -3
  16. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/test_tether.py +1 -1
  17. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tether/__init__.py +1 -1
  18. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tether/cli.py +2 -0
  19. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tether/context.py +4 -1
  20. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tether/multiplexer.py +37 -1
  21. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tether/store.py +7 -3
  22. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tether/tools/bash.py +19 -2
  23. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tether/tools/edit.py +20 -4
  24. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tether/unchanged.py +1 -1
  25. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/.claude/gru/active/.gitkeep +0 -0
  26. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/.claude/gru/active/north-star.md +0 -0
  27. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/.claude/gru/active/run-progress.md +0 -0
  28. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/.claude/gru/active/why-qwen-fails.md +0 -0
  29. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/.claude/gru/archive/.gitkeep +0 -0
  30. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/.claude/gru/archive/v0-2-bugs.md +0 -0
  31. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/.claude/gru/archive/work-on-v0-2-4.md +0 -0
  32. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/.claude/gru/why-qwen-fails/reg_ab.sh +0 -0
  33. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/.claude/gru/why-qwen-fails/regcount.py +0 -0
  34. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/.claude/gru/why-qwen-fails/whack.py +0 -0
  35. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/.claude/gru.json +0 -0
  36. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/.github/workflows/ci.yml +0 -0
  37. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/.github/workflows/delivery.yml +0 -0
  38. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/.github/workflows/docs.yml +0 -0
  39. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/.gitignore +0 -0
  40. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/CONTRIBUTING.md +0 -0
  41. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/LICENSE +0 -0
  42. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/README.md +0 -0
  43. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/README.md +0 -0
  44. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/canary.py +0 -0
  45. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/canary_baseline.json +0 -0
  46. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/compare.py +0 -0
  47. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/grade.py +0 -0
  48. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/harness-bench/README.md +0 -0
  49. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/harness-bench/tether-adapter.patch +0 -0
  50. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/history.jsonl +0 -0
  51. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/ladder/base.py +0 -0
  52. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/ladder/baseline/harness.jsonl +0 -0
  53. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/ladder/baseline/ladder.jsonl +0 -0
  54. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/ladder/charts.py +0 -0
  55. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/ladder/general.py +0 -0
  56. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/ladder/probe.py +0 -0
  57. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/ladder/refs.py +0 -0
  58. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/ladder/report.py +0 -0
  59. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/ladder/run.py +0 -0
  60. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/ladder/snapshot.py +0 -0
  61. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/ladder/tasks.py +0 -0
  62. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/ladder/validate.py +0 -0
  63. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/little_coder_recipe.md +0 -0
  64. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/naive_agent.py +0 -0
  65. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/report.py +0 -0
  66. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/run.py +0 -0
  67. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/code-hard/goal.txt +0 -0
  68. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/code-hard/hidden/test_hidden.py +0 -0
  69. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/code-hard/ref/calc/__init__.py +0 -0
  70. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/code-hard/ref/calc/errors.py +0 -0
  71. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/code-hard/ref/calc/evaluator.py +0 -0
  72. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/code-hard/ref/calc/parser.py +0 -0
  73. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/code-hard/ref/calc/tokenizer.py +0 -0
  74. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/code-hard/ws/calc/__init__.py +0 -0
  75. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/code-hard/ws/calc/errors.py +0 -0
  76. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/code-hard/ws/calc/evaluator.py +0 -0
  77. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/code-hard/ws/calc/parser.py +0 -0
  78. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/code-hard/ws/calc/tokenizer.py +0 -0
  79. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/code-hard/ws/tests/__init__.py +0 -0
  80. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/code-hard/ws/tests/test_calc.py +0 -0
  81. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/code-medium/goal.txt +0 -0
  82. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/code-medium/hidden/test_hidden.py +0 -0
  83. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/code-medium/ws/cli.py +0 -0
  84. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/code-medium/ws/ledger/__init__.py +0 -0
  85. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/code-medium/ws/ledger/parser.py +0 -0
  86. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/code-medium/ws/ledger/report.py +0 -0
  87. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/code-medium/ws/sample.csv +0 -0
  88. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/code-medium/ws/tests/__init__.py +0 -0
  89. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/code-medium/ws/tests/test_report.py +0 -0
  90. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/code-simple/goal.txt +0 -0
  91. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/code-simple/hidden/test_hidden.py +0 -0
  92. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/code-simple/ws/tests/__init__.py +0 -0
  93. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/code-simple/ws/tests/test_textutils.py +0 -0
  94. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/code-simple/ws/textutils.py +0 -0
  95. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/codereview/goal.txt +0 -0
  96. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/codereview/ws/inventory.py +0 -0
  97. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/content/goal.txt +0 -0
  98. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/content/ws/.keep +0 -0
  99. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/focus/goal.txt +0 -0
  100. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/focus/hidden/test_hidden.py +0 -0
  101. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/focus/ws/AGENTS.md +0 -0
  102. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/focus/ws/README.md +0 -0
  103. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/focus/ws/docs/architecture.md +0 -0
  104. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/focus/ws/docs/style.md +0 -0
  105. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/focus/ws/mini/__init__.py +0 -0
  106. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/focus/ws/mini/cli.py +0 -0
  107. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/focus/ws/mini/fmt.py +0 -0
  108. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/focus/ws/mini/stats.py +0 -0
  109. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/focus/ws/mini/textio.py +0 -0
  110. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/focus/ws/tests/__init__.py +0 -0
  111. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/focus/ws/tests/test_stats.py +0 -0
  112. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/plan/goal.txt +0 -0
  113. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/plan/ws/README.md +0 -0
  114. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/plan/ws/svc/__init__.py +0 -0
  115. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/plan/ws/svc/client.py +0 -0
  116. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/plan/ws/svc/config.py +0 -0
  117. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/qa/goal.txt +0 -0
  118. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/qa/ws/.keep +0 -0
  119. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/review/goal.txt +0 -0
  120. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/bench/tasks/review/ws/paper.md +0 -0
  121. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/docs/architecture.md +0 -0
  122. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/docs/benchmarks.md +0 -0
  123. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/docs/extending.md +0 -0
  124. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/docs/glossary.md +0 -0
  125. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/docs/guides/a-pipeline-with-checks.md +0 -0
  126. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/docs/guides/add-your-own-tool.md +0 -0
  127. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/docs/guides/fix-a-failing-test.md +0 -0
  128. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/docs/guides/use-tether-from-your-agent.md +0 -0
  129. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/docs/index.md +0 -0
  130. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/docs/javascripts/mathjax.js +0 -0
  131. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/docs/ladder/claude-haiku.md +0 -0
  132. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/docs/ladder/general.md +0 -0
  133. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/docs/ladder/img/harness-cost.svg +0 -0
  134. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/docs/ladder/img/harness-pass.svg +0 -0
  135. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/docs/ladder/img/task-grid.svg +0 -0
  136. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/docs/ladder/img/tiers.svg +0 -0
  137. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/docs/ladder/index.md +0 -0
  138. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/docs/ladder/results.md +0 -0
  139. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/docs/llms.txt +0 -0
  140. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/docs/reference/cli.md +0 -0
  141. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/docs/reference/context-and-store.md +0 -0
  142. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/docs/reference/harness.md +0 -0
  143. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/docs/reference/index.md +0 -0
  144. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/docs/reference/multiplexer-and-decorator.md +0 -0
  145. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/docs/reference/providers.md +0 -0
  146. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/docs/reference/sandbox-and-skills.md +0 -0
  147. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/docs/tutorial/agent-interface.md +0 -0
  148. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/docs/tutorial/cli-and-headless.md +0 -0
  149. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/docs/tutorial/index.md +0 -0
  150. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/docs/tutorial/multi-agent.md +0 -0
  151. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/docs/tutorial/sdk-and-custom-tools.md +0 -0
  152. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/docs/tutorial/security-and-sandbox.md +0 -0
  153. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/docs/tutorial/skills.md +0 -0
  154. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/e2e/__init__.py +0 -0
  155. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/e2e/conftest.py +0 -0
  156. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/e2e/proxy.py +0 -0
  157. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/e2e/test_agents.py +0 -0
  158. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/e2e/test_defaults.py +0 -0
  159. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/e2e/test_faults.py +0 -0
  160. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/e2e/test_lifecycle.py +0 -0
  161. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/e2e/test_limits.py +0 -0
  162. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/e2e/test_notes.py +0 -0
  163. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/e2e/test_restart.py +0 -0
  164. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/e2e/test_sandbox.py +0 -0
  165. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/e2e/test_surface.py +0 -0
  166. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/examples/course/README.md +0 -0
  167. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/examples/course/checks.py +0 -0
  168. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/examples/course/course.yaml +0 -0
  169. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/examples/course/ruff.toml +0 -0
  170. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/examples/course/skills/planner/SKILL.md +0 -0
  171. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/examples/course/skills/searcher/SKILL.md +0 -0
  172. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/examples/course/skills/searcher/tools.py +0 -0
  173. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/examples/course/skills/writer/SKILL.md +0 -0
  174. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/examples/course/skills/writer/tools.py +0 -0
  175. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/mkdocs.yml +0 -0
  176. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/pyproject.toml +0 -0
  177. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/scripts/record_golden.py +0 -0
  178. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/skills/researcher/SKILL.md +0 -0
  179. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/__init__.py +0 -0
  180. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/conftest.py +0 -0
  181. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/fixtures/dialects.jsonl +0 -0
  182. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/golden/coding_edit_failure_modes.json +0 -0
  183. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/golden/done_nudge.json +0 -0
  184. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/golden/done_nudge.snap.json +0 -0
  185. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/golden/read_range_pingpong.json +0 -0
  186. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/golden/read_range_pingpong.snap.json +0 -0
  187. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/golden/research_web.json +0 -0
  188. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/golden/research_web.snap.json +0 -0
  189. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/golden/shell_wrappers.json +0 -0
  190. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/golden/shell_wrappers.snap.json +0 -0
  191. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/golden/waiting_input_resume.json +0 -0
  192. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/golden/waiting_input_resume.snap.json +0 -0
  193. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/providers/__init__.py +0 -0
  194. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/providers/test_anthropic.py +0 -0
  195. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/providers/test_base.py +0 -0
  196. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/providers/test_declarative.py +0 -0
  197. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/providers/test_dialects.py +0 -0
  198. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/providers/test_ollama.py +0 -0
  199. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/providers/test_openai.py +0 -0
  200. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/providers/test_retry.py +0 -0
  201. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/test_agent_interface.py +0 -0
  202. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/test_auto_test.py +0 -0
  203. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/test_bench_littlecoder.py +0 -0
  204. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/test_benchmarks_docs.py +0 -0
  205. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/test_cli.py +0 -0
  206. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/test_cli_docs.py +0 -0
  207. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/test_context.py +0 -0
  208. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/test_context_config.py +0 -0
  209. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/test_decorator.py +0 -0
  210. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/test_docs_structure.py +0 -0
  211. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/test_failing_test_source.py +0 -0
  212. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/test_golden.py +0 -0
  213. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/test_guides_docs.py +0 -0
  214. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/test_harness.py +0 -0
  215. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/test_integration.py +0 -0
  216. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/test_ladder_general.py +0 -0
  217. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/test_ladder_run.py +0 -0
  218. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/test_llms_txt.py +0 -0
  219. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/test_misses.py +0 -0
  220. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/test_multiplexer.py +0 -0
  221. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/test_params.py +0 -0
  222. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/test_pipeline.py +0 -0
  223. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/test_providers_docs.py +0 -0
  224. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/test_quiet_and_fold.py +0 -0
  225. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/test_readme.py +0 -0
  226. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/test_regression_note.py +0 -0
  227. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/test_release_hardening.py +0 -0
  228. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/test_repeat_reads.py +0 -0
  229. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/test_restart.py +0 -0
  230. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/test_retro.py +0 -0
  231. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/test_sandbox.py +0 -0
  232. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/test_security_hardening.py +0 -0
  233. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/test_skills.py +0 -0
  234. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/test_small_rewrite.py +0 -0
  235. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/test_structured_history.py +0 -0
  236. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/test_test_reasoning.py +0 -0
  237. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/test_trace.py +0 -0
  238. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/test_troubleshooting_docs.py +0 -0
  239. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/test_unchanged_write.py +0 -0
  240. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/tools/__init__.py +0 -0
  241. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/tools/test_agent.py +0 -0
  242. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/tools/test_bash.py +0 -0
  243. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/tools/test_done.py +0 -0
  244. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/tools/test_edit.py +0 -0
  245. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/tools/test_mem.py +0 -0
  246. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tests/tools/test_web.py +0 -0
  247. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tether/api.py +0 -0
  248. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tether/decorator.py +0 -0
  249. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tether/harness.py +0 -0
  250. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tether/mcp.py +0 -0
  251. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tether/pipeline.py +0 -0
  252. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tether/progress.py +0 -0
  253. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tether/providers/__init__.py +0 -0
  254. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tether/providers/anthropic.py +0 -0
  255. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tether/providers/base.py +0 -0
  256. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tether/providers/declarative.py +0 -0
  257. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tether/providers/ollama.py +0 -0
  258. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tether/providers/openai.py +0 -0
  259. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tether/retro.py +0 -0
  260. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tether/sandbox.py +0 -0
  261. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tether/schema.py +0 -0
  262. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tether/skills.py +0 -0
  263. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tether/tools/__init__.py +0 -0
  264. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tether/tools/agent.py +0 -0
  265. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tether/tools/done.py +0 -0
  266. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tether/tools/mem.py +0 -0
  267. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tether/tools/web.py +0 -0
  268. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/tether/trace.py +0 -0
  269. {tether_sdk-0.2.17 → tether_sdk-0.2.18}/uv.lock +0 -0
@@ -71,7 +71,7 @@ Reviewers and the Team Leader cite the failing line when they reject a change.
71
71
  ```text
72
72
  [obs_3 folded: `web fetch https://...` (3,420 chars) | use `mem recall obs_3` to expand]
73
73
  ```
74
- - Exception: the latest read of each of the last 8 files (`edit view <p>`, `bash cat/head/tail/sed -n <p>`; paths normalized against the workspace) is not folded until `<p>` is edited (`edit write|replace`, or any other bash command naming it: `sed -i`, `tee`, redirects, `python -c`) or re-read. The head+tail elision still applies (an observation may use up to a third of `max_context_tokens`, at least 2,400 chars), and under `max_context_tokens` pressure it is folded like any other (oldest first). The `mem recall` hint is shown only when `mem` is enabled (else "re-run the command").
74
+ - Exception: the latest read of each of the last 8 files (`edit view <p>`, `bash cat/head/tail/sed -n <p>`; paths normalized against the workspace) is not folded until `<p>` is edited (`edit write|append|replace`, or any other bash command naming it: `sed -i`, `tee`, redirects, `python -c`) or re-read. The head+tail elision still applies (an observation may use up to a third of `max_context_tokens`, at least 2,400 chars), and under `max_context_tokens` pressure it is folded like any other (oldest first). The `mem recall` hint is shown only when `mem` is enabled (else "re-run the command").
75
75
  - A recognised test command piped to `head` (`<tests> 2>&1 | head -N`, nothing else piped) runs without the pipe and is cut by `bash` itself: first N lines, a `[... K lines cut by head ...]` marker, the last 6 lines and the tests' own `[exit N]`, so the summary and exit code survive (0 static prompt tokens, #173).
76
76
  - When a recognised test command fails, the harness appends the source of up to 3 failing test functions named in the traceback (`[failing test source]`, workspace files only, at most 1,500 chars, skipped when the output already shows it) so the model sees the test's inputs (0 static prompt tokens, no model call, #173). When the same suite ran before (same test count) and tests that passed then fail now, one `[regression]` line names them and the newly passing ones (at most 5 names each, 400 chars, #173). When a command that writes existing workspace files (`edit write|replace <p>`, `> p`, `>> p`, `tee p`) leaves all of them with the same code (identical bytes, or for `.py` an identical AST), one `[NUDGE]` line says so (`tether/unchanged.py`, at most 200 chars, 0 static prompt tokens, #173). A whole-file rewrite (`edit write p`, `> p`) of a file of 20 or more lines that changed at most 20% of them gets one `[NUDGE]` pointing to `edit replace p`, once per file per session (#173).
77
77
  - Repair loop around tests (#173, 0 static prompt tokens, no model call): once the model has run a recognised test command, the harness re-runs it after each command that writes an existing workspace file and appends the result (`[auto-test]`, Aider's auto-test), so no version is typed blind. When the model first reads the test file of a starting file (`x_test.py`/`test_x.py` next to `x.py`), one `[BEFORE WRITING]` line asks it to state in plain words what the 3 hardest tests call and expect (AlphaCodium, Ridnik et al. 2024); a plain-text reply then is the expected answer, not a nudge. If it writes first, that first rewrite is held once with the same question. When the same tests fail again after a change, or at most 3 fail, a runtime trace of the smallest failing test is appended once per failing set (`tether/trace.py`: calls into workspace code with arguments and results, 2 levels deep, at most 30 lines / 1,500 chars; LDB, Zhong et al. ACL 2024). The first near pass also gets one `[NUDGE]` pointing to `edit replace`.
@@ -120,7 +120,7 @@ tether/
120
120
  ├── done.py # Mandatory explicit completion command (`done`)
121
121
  ├── bash.py # Kernel-sandboxed, env-scrubbed, workspace-bounded shell execution
122
122
  ├── web.py # Zero-config DuckDuckGo Lite httpx search (+ Brave/Tavily/SearXNG env override) & reader
123
- ├── edit.py # Workspace-jailed file viewing (`view`) & stdin patching (`write`, `replace`)
123
+ ├── edit.py # Workspace-jailed file viewing (`view`) & stdin patching (`write`, `append`, `replace`)
124
124
  ├── mem.py # Working scratchpad (`pin`/`unpin`), FTS5 search (`search`), & recall (`recall`)
125
125
  └── agent.py # Async multi-agent orchestration (`spawn`, `status`, `wait`, `query`, `read`, `send`)
126
126
  ```
@@ -136,9 +136,9 @@ tether/
136
136
  - `chunks_fts` *(SQLite FTS5 Virtual Table)*: `session_id`, `source_type` (`result` | `observation` | `pin`), `source_id`, `chunk_index`, `content` — automatically indexes ~150-token paragraph/heading chunks of all observations, pins, and final `done` deliverables for sub-millisecond BM25 RAG (including cross-session project search via `mem search --project <query>`).
137
137
  - `pins`: `session_id`, `key`, `value` (supports session-scoped working memory and workspace-wide semantic facts under `GLOBAL_SESSION_ID = "__project__"` via `mem pin --project <key> <val>`).
138
138
  - `inbox`: `id`, `session_id`, `message`, `consumed` (`0` or `1`), `created_at`.
139
- - **Agent-to-Agent Interface (`api.py`, `mcp.py`):** `--json` outputs (schema `v: 1`), exit codes `0` completed / `1` usage / `2` waiting (also stuck or out of steps, handed back) / `3` gate / `5` worker error, failure text on stderr, `--result-file`, `--output-schema`, `tether events`. `tether mcp` serves the same JSON over stdio and requires the optional `tether-sdk[mcp]` extra (official `mcp` SDK, imported lazily so core stays dependency-light; Rule 7 allows it as an extra only); its sandbox is always rooted at `--workspace` and callers can only narrow it. Details: `docs/reference/agent-interface.md`.
139
+ - **Agent-to-Agent Interface (`api.py`, `mcp.py`):** `--json` outputs (schema `v: 1`), exit codes `0` completed / `1` usage / `2` waiting (also stuck or out of steps, handed back) / `3` gate / `5` worker error, failure text on stderr, a foreground `run` writes `session ses_<id>` to stderr at creation (#90), `--result-file`, `--output-schema`, `tether events`. `tether mcp` serves the same JSON over stdio and requires the optional `tether-sdk[mcp]` extra (official `mcp` SDK, imported lazily so core stays dependency-light; Rule 7 allows it as an extra only); its sandbox is always rooted at `--workspace` and callers can only narrow it. Details: `docs/reference/agent-interface.md`.
140
140
  - **Telemetry & Failure-Mode Inspector (`tether stats`):**
141
- - `tether stats [--model <m>] [--skill <s>] [--limit <n>]` aggregates per-model pass rates, cumulative token economy (`total_prompt_tokens + total_completion_tokens`), step latency, and self-healing ACI friction (`nudge`, `loop_stall`, `cycle_stall`, `syntax_error`, `tool_error`, `gate_fail`, `gate_error`), plus a top-offenders breakdown by tool command.
141
+ - `tether stats [--model <m>] [--skill <s>] [--limit <n>]` aggregates per-model pass rates, cumulative token economy (`total_prompt_tokens + total_completion_tokens`), step latency, and self-healing ACI friction (`nudge`, `loop_stall`, `cycle_stall`, `syntax_error`, `tool_error`, `gate_fail`, `gate_error`), plus a top-offenders breakdown by tool command (a leading `cd <dir> &&` is skipped; no command is `(no command)`, #79).
142
142
  - **Post-Mortem Distillation (`tether retro <session_id> [--apply] [--model <m>]`):** offline only (never mutates a live prompt). `store.extract_friction_trace` pulls `inbox` corrections and `loop_stall`/`cycle_stall`/`syntax_error`/`tool_error`/`gate_fail`/`gate_error` turns (+ the fixing command); one bounded LLM pass yields ≤2 rules (≤30 tokens each, deduped against existing rules). Prints a unified diff of `SKILL.md`; `--apply` appends under `## Learned Rules` (or pins to project memory when no skill was used).
143
143
  - **Headless Worker & Live `send` Contract:**
144
144
  - `max_steps` is the absolute session ceiling. `send` on a session that used its steps extends it to `step_count + <Harness budget>` (a session paused earlier keeps its remaining budget), so `step_count` never exceeds `max_steps` (#75).
@@ -219,7 +219,7 @@ uv run mypy tether/
219
219
  2. **Async-First Design:**
220
220
  - All model calls and I/O-bound tool executions must be `async`/`await` native, while seamlessly wrapping synchronous user `@tool` functions.
221
221
  3. **Graceful Degradation on 9B Hallucinations:**
222
- - Small models occasionally emit `cmd` with minor quirks (e.g., leading `$`, wrapping backticks, or calling a tool name directly instead of `act`). The multiplexer must normalize trivial syntax quirks deterministically before failing. This includes unescaping literal `\n`/`\t` in one-line `stdin` for `edit write`/`edit replace` and `done` (never `bash`), turning a trailing shell heredoc in `cmd` (`edit write f <<'EOF' ... EOF`) into `stdin` (never for `bash`), rewriting `edit --file p --content c` flags into `edit write p` + stdin (and `edit write p <text>` with no stdin into `edit write p` + `<text>` as typed) and `done --stdin 'x'` into `done` + stdin, unwrapping `bash -c/-lc '<cmd>'` and `sh -c` wrappers, unwrapping an `act("<cmd>", stdin="...")` call typed as text in `cmd` (also after `bash`) into the command and its `stdin` (#169), running an unknown first word through the enabled `bash` tool (never for disabled built-ins), registering extra quirk fixers with `register_normalizer`, mapping a native tool call named other than `act` (also written as plain-text JSON `{"name": ..., "arguments": {...}}`) to `<name> --k 'v'` so the JIT usage answers it, inferring the `edit` verb (`edit <path>` -> view/replace/write) and accepting `apply_patch` (`*** Begin Patch` or unified-diff patches, also when a diff arrives as `edit <path>` stdin) as an `edit` verb.
222
+ - Small models occasionally emit `cmd` with minor quirks (e.g., leading `$`, wrapping backticks, or calling a tool name directly instead of `act`). The multiplexer must normalize trivial syntax quirks deterministically before failing. This includes unescaping literal `\n`/`\t` in one-line `stdin` for `edit write`/`edit replace` and `done` (never `bash`), turning a trailing shell heredoc in `cmd` (`edit write f <<'EOF' ... EOF`) into `stdin` (never for `bash`), rewriting `edit --file p --content c` flags into `edit write p` + stdin (and `edit write p <text>` with no stdin into `edit write p` + `<text>` as typed) and `done --stdin 'x'` into `done` + stdin, unwrapping `bash -c/-lc '<cmd>'` and `sh -c` wrappers, unwrapping an `act("<cmd>", stdin="...")` call typed as text in `cmd` (also after `bash`) into the command and its `stdin` (#169), running an unknown first word through the enabled `bash` tool (never for disabled built-ins), running a bash `cd <missing dir> && <cmd>` as `<cmd>` in the workspace with a one-line note (#79), running plain shell file writes/reads as `edit` when `edit` is on and `bash` is off (`echo t > p`, `printf t > p`, `cat > p` + heredoc -> `edit write p`, with `>>` -> `edit append p`; `cat p` -> `edit view p`), registering extra quirk fixers with `register_normalizer`, mapping a native tool call named other than `act` (also written as plain-text JSON `{"name": ..., "arguments": {...}}`) to `<name> --k 'v'` so the JIT usage answers it, inferring the `edit` verb (`edit <path>` -> view/replace/write) and accepting `apply_patch` (`*** Begin Patch` or unified-diff patches, also when a diff arrives as `edit <path>` stdin) as an `edit` verb.
223
223
  4. **Golden traces:** behaviour the model sees (framing, folding, nudges, tool output) is locked by `tests/golden/*.snap.json`. A PR that changes it runs `UPDATE_GOLDEN=1 pytest tests/test_golden.py` and the snapshot diff is part of the review; unrelated traces must not change. See `CONTRIBUTING.md`.
224
224
  5. **E2E scenarios:** every feature or bug fix ships with a scenario in `e2e/` (real CLI, real ollama behind a fault-injecting proxy, local only, `TETHER_E2E=1 uv run pytest e2e`). Assert on what tether sends and records, never on the model's skill; script the reply or inject the fault so the test does not depend on model potency. **Before merging any PR, run `TETHER_E2E=1 uv run pytest e2e` locally and put the result in the PR description (CI cannot run it). Every failure must be mitigated before merge: fix the code, or fix a wrong scenario, or record in the PR why it is acceptable and what follows up. A PR is not merged with an unexplained red scenario.** See `CONTRIBUTING.md`.
225
225
  6. **Documentation Integrity:**
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: tether-sdk
3
- Version: 0.2.17
3
+ Version: 0.2.18
4
4
  Summary: General-purpose, headless-first LLM-Native micro-harness for small language models
5
5
  Project-URL: Homepage, https://github.com/igormcsouza/tether
6
6
  Project-URL: Repository, https://github.com/igormcsouza/tether
@@ -17,7 +17,7 @@ Machine-readable surface for calling Tether from another agent. Setup per harnes
17
17
  - `failure` is `{"kind": "gate|stopped|worker_error", "gate": "<cmd>|output-schema|null", "message": "…"}`.
18
18
  - Keys are stable; new keys may be added.
19
19
 
20
- `--json` is available on `run`, `pipeline`, `status`, `list`, `read` (also `--digest`, `--steps`, `--full`), `wait`, `send` and `stats`. With `--headless` it prints `{"v":1,"id":"ses_…"}`.
20
+ `--json` is available on `run`, `pipeline`, `status`, `list`, `read` (also `--digest`, `--steps`, `--full`), `wait`, `send` and `stats`. With `--headless` it prints `{"v":1,"id":"ses_…"}`. A foreground `run` (with or without `--json`) writes `session ses_…` to stderr as soon as the session exists, before the first model call, so a caller that kills it on its own timeout can still `status`, `stop` or `send` it; stdout is unchanged.
21
21
 
22
22
  ## Exit codes
23
23
 
@@ -16,6 +16,8 @@
16
16
 
17
17
  ## `tether.tools.edit`
18
18
 
19
+ With `edit` enabled and `bash` not, a plain shell file write or read runs as `edit`: `echo ok > f`, `printf 'a\nb' > f` and `cat > f << 'EOF' ... EOF` as `edit write f`, `cat f` as `edit view f`, and `>> f` as `edit append f`. `edit append <path>` adds `stdin` to the end of a file (created if missing); `edit write` replaces it. Other shell commands answer `unknown command` with a pointer to `edit`.
20
+
19
21
  ::: tether.tools.edit
20
22
  options:
21
23
  show_root_heading: false
@@ -1,5 +1,22 @@
1
1
  # Release Notes
2
2
 
3
+ ## Unreleased
4
+
5
+ ## v0.2.18 (2026-11-08)
6
+
7
+ Small fixes from the v0.2.17 release check and the paasio labs: shell-style file writes work when only `edit` is enabled, `edit append` adds to a file instead of replacing it, a foreground run prints its session id at once, and a `cd` into a container path that does not exist no longer costs a step.
8
+
9
+ ### Added
10
+
11
+ - `edit append <path>` adds `stdin` to the end of a file (created if missing, with a newline added when the file does not end with one). Small models assumed `edit write` appends: gemma4:e4b wrote a plan module by module and kept only the last one. The `edit` help now says `write replaces the file` and stays within 59 tokens; with `bash` off, `echo t >> f` runs as `edit append f` (#34).
12
+ - A foreground `tether run` (with or without `--json`) writes `session ses_<id>` to stderr as soon as the session is created, before the first model call. A caller that kills the run on its own timeout no longer needs `tether list` to find the id for `status`, `stop` or `send`; stdout is unchanged (#90).
13
+
14
+ ### Fixed
15
+
16
+ - `cd /testbed && python3 -m unittest ...`, with a directory that does not exist, now runs the command after the `cd` in the workspace, with one line saying the `cd` was skipped. Models assume a container path; qwen3.5:9b lost a step to it in 3 of the last 6 paasio runs. A `cd` into a real directory runs as before (#79).
17
+ - `tether stats` offenders: a leading `cd <dir> &&` no longer makes `cd` the offending command (the command after it is counted), and a turn without a command shows as `(no command)` instead of `unknown` (#79).
18
+ - With `edit` enabled and `bash` not, a plain shell file write or read now runs as `edit`: `echo ok > hello.txt`, `printf 'a\nb' > f`, `cat > f << 'EOF' ... EOF` become `edit write`, and `cat f` becomes `edit view f`. Any other shell command still answers `unknown command`, now with a pointer to `edit view|write`. In the v0.2.17 release check (`--tools edit`, "Create hello.txt containing ok"), qwen3.5:9b tried `echo`, `printf`, `cat` and `ls` 10 times before writing the file at step 12 of 15. Pipes are not translated.
19
+
3
20
  ## v0.2.17 (2026-11-07)
4
21
 
5
22
  When tests fail, tether now works around them on its own time: it re-runs them after each edit, traces the smallest failing test, starts fresh when an approach keeps failing, and keeps a version that nearly passes instead of throwing it away. The north star (74% on Polyglot-Python with qwen3.5:9b) moves to v0.4.0. No full Polyglot run was made for this release; the numbers below are from targeted labs.
@@ -64,7 +64,7 @@ A session whose last test run passed after its final change ends `COMPLETED` ins
64
64
 
65
65
  **Cause.** One very long generation can drop content, and `edit write` replaces the whole file (it reports what an overwrite removed).
66
66
 
67
- **Fix.** Write one small file per section and join them with a tool, rewrite the complete file, or use `edit replace` for a range. See [Built-in Tools](tutorial/built-in-tools.md#example-course-builder).
67
+ **Fix.** Write the file in parts with `edit append <path>` (each part in `stdin`), rewrite the complete file, or use `edit replace` for a range. See [Built-in Tools](tutorial/built-in-tools.md#example-course-builder).
68
68
 
69
69
  ### The model repeats a tool call with a value that was rejected
70
70
 
@@ -89,7 +89,7 @@ act(cmd="mem recall obs_3")
89
89
 
90
90
  The [course-builder example](https://github.com/igormcsouza/tether/tree/main/examples/course) uses `edit` and custom tools to turn a plan into a course. Three limits shaped it:
91
91
 
92
- - **`edit write` replaces the whole file.** Overwriting an existing file now reports `Replaced N lines with M (X removed, Y added; first removed: ...)` and, when the file shrank, points to `edit replace --lines a:b` ([#40](https://github.com/igormcsouza/tether/issues/40)). Small models assume it appends and silently lose earlier content. The planner skill says so explicitly: "write the COMPLETE plan in ONE call". (An `edit append` is proposed in [#34](https://github.com/igormcsouza/tether/issues/34).)
92
+ - **`edit write` replaces the whole file.** Overwriting an existing file now reports `Replaced N lines with M (X removed, Y added; first removed: ...)` and, when the file shrank, points to `edit replace --lines a:b` ([#40](https://github.com/igormcsouza/tether/issues/40)). Small models assume it appends and silently lose earlier content. To build a file in parts, use `edit append <path>` with the next part in `stdin`; it creates the file if needed and adds a newline when the file does not end with one.
93
93
  - **`web search` cannot reliably find a specific YouTube video.** Use a [custom tool](sdk-and-custom-tools.md#pattern-numbered-candidates) that returns numbered candidates instead.
94
94
  - **Tools are opt-in.** The searcher skill lists `tools: [yt-todo, yt-candidates, yt-save]` and nothing else; `edit` is only loaded by the stages that write files.
95
95
 
@@ -72,7 +72,7 @@ Each stage needs a `goal`. Invalid manifests print `Error: invalid pipeline ...`
72
72
  tether stats [--model <m>] [--skill <s>] [--limit <n>]
73
73
  ```
74
74
 
75
- Prints per-model runs, pass rate, average steps, peak and total tokens, and friction counts (`nudge`, `loop_stall`, `cycle_stall`, `syntax_error`, `tool_error`, `gate_fail`, `gate_error`), followed by the commands that cause the most friction. Pipeline root sessions are excluded so tokens are not double-counted.
75
+ Prints per-model runs, pass rate, average steps, peak and total tokens, and friction counts (`nudge`, `loop_stall`, `cycle_stall`, `syntax_error`, `tool_error`, `gate_fail`, `gate_error`), followed by the commands that cause the most friction (keyed by tool and verb, such as `edit replace`; a leading `cd <dir> &&` is skipped, so `cd src && pytest` counts as `pytest`, and a turn with no command is `(no command)`). Pipeline root sessions are excluded so tokens are not double-counted.
76
76
 
77
77
  ## Post-mortem rules (`tether retro`)
78
78
 
@@ -2,6 +2,8 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
+ import json
6
+
5
7
  from e2e.conftest import Tether
6
8
 
7
9
 
@@ -15,7 +17,19 @@ def test_verbose_prints_one_stderr_line_per_step_and_keeps_stdout(tether: Tether
15
17
  assert "\r" not in p.stderr # no dots when stderr is not a terminal
16
18
 
17
19
 
18
- def test_a_piped_run_without_verbose_is_silent_on_stderr(tether: Tether, chaos) -> None:
20
+ def test_a_piped_run_without_verbose_prints_only_the_session_id_on_stderr(
21
+ tether: Tether, chaos
22
+ ) -> None:
19
23
  chaos.script(("done", "ok"))
20
24
  p = tether.cli("run", "--model", "e2e/scripted", "go")
21
- assert (p.stdout, p.stderr) == ("ok\n", "")
25
+ assert p.stdout == "ok\n"
26
+ sid = p.stderr.removeprefix("session ").strip() # #90: there before the first model call
27
+ assert p.stderr == f"session {sid}\n" and sid.startswith("ses_")
28
+ assert tether.cli("status", sid).returncode == 0
29
+
30
+
31
+ def test_a_killed_json_run_still_names_its_session_on_stderr(tether: Tether, chaos) -> None:
32
+ chaos.script(("done", "ok"))
33
+ p = tether.cli("run", "--json", "--model", "e2e/scripted", "go")
34
+ assert p.stderr.startswith("session ses_")
35
+ assert p.stderr.split()[1] == json.loads(p.stdout)["id"] # stdout JSON unchanged
@@ -16,6 +16,13 @@ def test_heredoc_in_cmd_becomes_stdin(tether: Tether, chaos) -> None:
16
16
  assert (tether.ws / "a.txt").read_text() == "hello"
17
17
 
18
18
 
19
+ def test_shell_file_write_runs_as_edit_without_bash(tether: Tether, chaos) -> None:
20
+ chaos.script("echo ok > hello.txt", "cat hello.txt", ("done", "ok"))
21
+ r = tether.run("Create hello.txt containing ok", "--tools", "edit")
22
+ assert (tether.ws / "hello.txt").read_text() == "ok\n"
23
+ assert tether.events(r["id"])[:2] == ["ok", "ok"]
24
+
25
+
19
26
  def test_bare_shell_command_runs_through_bash(tether: Tether, chaos) -> None:
20
27
  (tether.ws / "marker.txt").write_text("x")
21
28
  chaos.script("ls", ("done", "ok"))
@@ -272,3 +279,21 @@ def test_act_call_typed_as_text_is_unwrapped(tether: Tether, chaos) -> None:
272
279
  chaos.script('act("done", stdin="all green")')
273
280
  r = tether.run("finish", "--tools", "bash")
274
281
  assert r["status"] == "COMPLETED" and r["result"] == "all green"
282
+
283
+
284
+ def test_edit_append_builds_a_file_in_parts(tether: Tether, chaos) -> None:
285
+ chaos.script(
286
+ ("edit append plan.md", "# Module 1\n"),
287
+ ("edit append plan.md", "# Module 2\n"),
288
+ ("done", "ok"),
289
+ )
290
+ tether.run("plan", "--tools", "edit")
291
+ assert (tether.ws / "plan.md").read_text() == "# Module 1\n# Module 2\n"
292
+
293
+
294
+ def test_a_cd_into_a_missing_container_dir_is_skipped(tether: Tether, chaos) -> None:
295
+ (tether.ws / "marker.txt").write_text("x")
296
+ chaos.script("cd /testbed && ls", ("done", "ok"))
297
+ r = tether.run("list", "--tools", "bash")
298
+ out = tether.tool_outputs(r["id"])[0]
299
+ assert "`cd /testbed` skipped" in out and "marker.txt" in out
@@ -24,7 +24,7 @@
24
24
  "role": "assistant"
25
25
  },
26
26
  {
27
- "content": "Observation:\n[obs_1] Error: unknown command `sed`. Enabled tools: done, edit. Enable more: --tools bash,edit (CLI), tools=[...] (SDK), `tools:` (skill).",
27
+ "content": "Observation:\n[obs_1] Error: unknown command `sed`. Enabled tools: done, edit. Enable more: --tools bash,edit (CLI), tools=[...] (SDK), `tools:` (skill). Files: `edit view <path>`, `edit write <path>` with the text in stdin.",
28
28
  "role": "user"
29
29
  }
30
30
  ],
@@ -42,7 +42,7 @@
42
42
  "role": "assistant"
43
43
  },
44
44
  {
45
- "content": "Observation:\n[obs_1] Error: unknown command `sed`. Enabled tools: done, edit. Enable more: --tools bash,edit (CLI), tools=[...] (SDK), `tools:` (skill).",
45
+ "content": "Observation:\n[obs_1] Error: unknown command `sed`. Enabled tools: done, edit. Enable more: --tools bash,edit (CLI), tools=[...] (SDK), `tools:` (skill). Files: `edit view <path>`, `edit write <path>` with the text in stdin.",
46
46
  "role": "user"
47
47
  },
48
48
  {
@@ -68,7 +68,7 @@
68
68
  "role": "assistant"
69
69
  },
70
70
  {
71
- "content": "Observation:\n[obs_1] Error: unknown command `sed`. Enabled tools: done, edit. Enable more: --tools bash,edit (CLI), tools=[...] (SDK), `tools:` (skill).",
71
+ "content": "Observation:\n[obs_1] Error: unknown command `sed`. Enabled tools: done, edit. Enable more: --tools bash,edit (CLI), tools=[...] (SDK), `tools:` (skill). Files: `edit view <path>`, `edit write <path>` with the text in stdin.",
72
72
  "role": "user"
73
73
  },
74
74
  {
@@ -102,7 +102,7 @@
102
102
  "role": "assistant"
103
103
  },
104
104
  {
105
- "content": "Observation:\n[obs_1] Error: unknown command `sed`. Enabled tools: done, edit. Enable more: --tools bash,edit (CLI), tools=[...] (SDK), `tools:` (skill).",
105
+ "content": "Observation:\n[obs_1] Error: unknown command `sed`. Enabled tools: done, edit. Enable more: --tools bash,edit (CLI), tools=[...] (SDK), `tools:` (skill). Files: `edit view <path>`, `edit write <path>` with the text in stdin.",
106
106
  "role": "user"
107
107
  },
108
108
  {
@@ -144,7 +144,7 @@
144
144
  "role": "assistant"
145
145
  },
146
146
  {
147
- "content": "Observation:\n[obs_1] Error: unknown command `sed`. Enabled tools: done, edit. Enable more: --tools bash,edit (CLI), tools=[...] (SDK), `tools:` (skill).",
147
+ "content": "Observation:\n[obs_1] Error: unknown command `sed`. Enabled tools: done, edit. Enable more: --tools bash,edit (CLI), tools=[...] (SDK), `tools:` (skill). Files: `edit view <path>`, `edit write <path>` with the text in stdin.",
148
148
  "role": "user"
149
149
  },
150
150
  {
@@ -194,7 +194,7 @@
194
194
  "role": "assistant"
195
195
  },
196
196
  {
197
- "content": "Observation:\n[obs_1] Error: unknown command `sed`. Enabled tools: done, edit. Enable more: --tools bash,edit (CLI), tools=[...] (SDK), `tools:` (skill).",
197
+ "content": "Observation:\n[obs_1] Error: unknown command `sed`. Enabled tools: done, edit. Enable more: --tools bash,edit (CLI), tools=[...] (SDK), `tools:` (skill). Files: `edit view <path>`, `edit write <path>` with the text in stdin.",
198
198
  "role": "user"
199
199
  },
200
200
  {
@@ -252,7 +252,7 @@
252
252
  "role": "assistant"
253
253
  },
254
254
  {
255
- "content": "Observation:\n[obs_1] Error: unknown command `sed`. Enabled tools: done, edit. Enable more: --tools bash,edit (CLI), tools=[...] (SDK), `tools:` (skill).",
255
+ "content": "Observation:\n[obs_1] Error: unknown command `sed`. Enabled tools: done, edit. Enable more: --tools bash,edit (CLI), tools=[...] (SDK), `tools:` (skill). Files: `edit view <path>`, `edit write <path>` with the text in stdin.",
256
256
  "role": "user"
257
257
  },
258
258
  {
@@ -318,7 +318,7 @@
318
318
  "role": "assistant"
319
319
  },
320
320
  {
321
- "content": "Observation:\n[obs_1] Error: unknown command `sed`. Enabled tools: done, edit. Enable more: --tools bash,edit (CLI), tools=[...] (SDK), `tools:` (skill).",
321
+ "content": "Observation:\n[obs_1] Error: unknown command `sed`. Enabled tools: done, edit. Enable more: --tools bash,edit (CLI), tools=[...] (SDK), `tools:` (skill). Files: `edit view <path>`, `edit write <path>` with the text in stdin.",
322
322
  "role": "user"
323
323
  },
324
324
  {
@@ -392,7 +392,7 @@
392
392
  "role": "assistant"
393
393
  },
394
394
  {
395
- "content": "Observation:\n[obs_1] Error: unknown command `sed`. Enabled tools: done, edit. Enable more: --tools bash,edit (CLI), tools=[...] (SDK), `tools:` (skill).",
395
+ "content": "Observation:\n[obs_1] Error: unknown command `sed`. Enabled tools: done, edit. Enable more: --tools bash,edit (CLI), tools=[...] (SDK), `tools:` (skill). Files: `edit view <path>`, `edit write <path>` with the text in stdin.",
396
396
  "role": "user"
397
397
  },
398
398
  {
@@ -476,7 +476,7 @@
476
476
  "files": {
477
477
  "calc.py": "def total(xs):\n t = 0\n for x in xs:\n t += x\n return t\n\n\ndef mean(xs):\n return total(xs) / len(xs) # fixed\n"
478
478
  },
479
- "peak_tokens": 655,
479
+ "peak_tokens": 673,
480
480
  "result": "Fixed off-by-one in total().",
481
481
  "status": "COMPLETED",
482
482
  "step_count": 10
@@ -0,0 +1,71 @@
1
+ """With `edit` on and `bash` off, plain shell file reads and writes run as `edit`.
2
+
3
+ In the v0.2.17 release check, `--tools edit` and "Create hello.txt containing ok": qwen3.5:9b tried
4
+ `echo ok > hello.txt`, `printf`, `cat` and `ls` 10 times (each `unknown command`) and wrote the
5
+ file at step 12 of 15.
6
+ """
7
+
8
+ from __future__ import annotations
9
+
10
+ from pathlib import Path
11
+
12
+ from tests.conftest import FakeScriptedProvider
13
+ from tether import ActionCall, Harness, ModelResponse
14
+ from tether.sandbox import SandboxPolicy
15
+
16
+
17
+ async def _run(tmp_path: Path, calls: list[tuple[str, str | None]], tools: list[str]) -> list[str]:
18
+ provider = FakeScriptedProvider(
19
+ [ModelResponse(content="", action=ActionCall(cmd=c, stdin=s)) for c, s in calls]
20
+ )
21
+ h = Harness(
22
+ db_path=tmp_path / "t.db",
23
+ tools=tools,
24
+ provider=provider,
25
+ max_steps=len(calls),
26
+ sandbox=SandboxPolicy(workspace_root=tmp_path, use_kernel_sandbox=False),
27
+ )
28
+ session = await h.run("goal")
29
+ return [t.content for t in h.store.get_turns(session.id) if t.role == "tool"]
30
+
31
+
32
+ async def test_shell_writes_and_reads_run_as_edit(tmp_path: Path) -> None:
33
+ out = await _run(
34
+ tmp_path,
35
+ [
36
+ ("echo ok > hello.txt", None),
37
+ ("printf 'a\\nb' > two.txt", None),
38
+ ("cat > three.txt << 'EOF'\nx = 1\nEOF", None),
39
+ ("bash echo hi there > four.txt", None),
40
+ ("cat hello.txt", None),
41
+ ],
42
+ ["edit"],
43
+ )
44
+ assert (tmp_path / "hello.txt").read_text() == "ok\n"
45
+ assert (tmp_path / "two.txt").read_text() == "a\nb"
46
+ assert (tmp_path / "three.txt").read_text().strip() == "x = 1"
47
+ assert (tmp_path / "four.txt").read_text() == "hi there\n"
48
+ assert "ok" in out[4] and "unknown command" not in "".join(out)
49
+
50
+
51
+ async def test_other_commands_point_to_edit_and_bash_is_untouched(tmp_path: Path) -> None:
52
+ calls = [("ls", None), ("echo ok >> a.txt", None), ("ls > c.txt", None)]
53
+ out = await _run(tmp_path, calls, ["edit"])
54
+ assert "unknown command `ls`" in out[0] and "`edit write <path>`" in out[0]
55
+ assert (tmp_path / "a.txt").read_text() == "ok\n" # `>>` runs as `edit append` (#34)
56
+ assert "unknown command `ls`" in out[2] and not (tmp_path / "c.txt").exists()
57
+ out = await _run(tmp_path, [("echo ok > b.txt", None)], ["edit", "bash"])
58
+ assert (tmp_path / "b.txt").read_text() == "ok\n" # real shell, not the translation
59
+
60
+
61
+ async def test_a_cd_into_a_missing_dir_is_skipped(tmp_path: Path) -> None:
62
+ """#79: `cd /testbed && python3 -m unittest` cost qwen3.5:9b a step in 3 of 6 paasio runs."""
63
+ (tmp_path / "sub").mkdir()
64
+ (tmp_path / "sub" / "x.txt").write_text("in sub")
65
+ out = await _run(
66
+ tmp_path,
67
+ [("cd /testbed && echo here", None), ("cd sub && cat x.txt", None)],
68
+ ["bash"],
69
+ )
70
+ assert out[0].startswith("[`cd /testbed` skipped: no such directory") and "here" in out[0]
71
+ assert "in sub" in out[1] and "skipped" not in out[1] # a real dir is entered as before
@@ -248,3 +248,17 @@ async def test_unified_diff_stdin_is_applied_not_written(tmp_path: Path) -> None
248
248
  assert (tmp_path / "a.py").read_text().startswith("x = 9\n")
249
249
  bad = "--- a.py\n+++ a.py\n@@ -1 +1 @@\n-nope\n+yes\n"
250
250
  assert "not found" in (await mux.execute("edit a.py", stdin=bad)).output
251
+
252
+
253
+ async def test_append_adds_to_the_file_instead_of_replacing_it(tmp_path: Path) -> None:
254
+ """#34: gemma4:e4b wrote a plan module by module with `edit write`, keeping only the last."""
255
+ mux = _mux(tmp_path)
256
+ out = (await mux.execute("edit append plan.md", stdin="# Module 1\n")).output
257
+ assert out == "Appended 1 lines to `plan.md` (1 lines now)."
258
+ (tmp_path / "plan.md").write_text("# Module 1") # no trailing newline: one is added
259
+ await mux.execute("edit append plan.md", stdin="# Module 2\n")
260
+ await mux.execute("edit append plan.md # Module 3") # text typed after the path
261
+ assert (tmp_path / "plan.md").read_text() == "# Module 1\n# Module 2\n# Module 3\n"
262
+ err = (await mux.execute("edit append plan.md")).output
263
+ assert err.startswith("Error: `edit append` requires `<path>` and the text in `stdin`.")
264
+ assert "write replaces the file" in (await mux.execute("edit --help")).output
@@ -4,6 +4,7 @@ from __future__ import annotations
4
4
 
5
5
  import asyncio
6
6
  import io
7
+ import re
7
8
  from pathlib import Path
8
9
  from typing import Any
9
10
 
@@ -129,7 +130,8 @@ async def test_cli_is_silent_by_default_when_stderr_is_not_a_tty(
129
130
  ) -> None:
130
131
  register_provider("prog-test", lambda name: _Done())
131
132
  assert await _async_main(["--model", "prog-test/m", "--db", str(tmp_path / "t.db"), "g"]) == 0
132
- assert capsys.readouterr().err == ""
133
+ err = capsys.readouterr().err # no spinner: only the session id line (#90)
134
+ assert re.fullmatch(r"session ses_\w+\n", err)
133
135
 
134
136
 
135
137
  def test_dots_label_cuts_a_long_command(tmp_path: Path) -> None:
@@ -111,11 +111,14 @@ def test_project_memory_and_episodic_rag(tmp_path: Path) -> None:
111
111
 
112
112
  def test_telemetry_migration_and_stats_aggregation(tmp_path: Path) -> None:
113
113
  """Verify legacy DB migration, canonical_tool_command, and get_stats / format_stats_report."""
114
- assert canonical_tool_command(None) == "unknown"
115
- assert canonical_tool_command(" ") == "unknown"
116
- assert canonical_tool_command('""') == "unknown"
114
+ assert canonical_tool_command(None) == "(no command)"
115
+ assert canonical_tool_command(" ") == "(no command)"
116
+ assert canonical_tool_command('""') == "(no command)"
117
117
  assert canonical_tool_command("$ tether edit replace a.py --lines 1:2") == "edit replace"
118
118
  assert canonical_tool_command("`bash pytest -q`") == "bash"
119
+ # #79: a leading `cd <dir> &&` is not the command
120
+ assert canonical_tool_command("cd /testbed && python3 -m unittest") == "python3"
121
+ assert canonical_tool_command("bash cd src; cd .. && edit view a.py") == "edit view"
119
122
 
120
123
  legacy_db = tmp_path / "legacy.db"
121
124
  with sqlite3.connect(str(legacy_db)) as raw_conn:
@@ -7,6 +7,6 @@ import tether
7
7
 
8
8
  def test_version_and_public_exports() -> None:
9
9
  """Verify package __version__ and public SDK symbols."""
10
- assert tether.__version__ == "0.2.17"
10
+ assert tether.__version__ == "0.2.18"
11
11
  for symbol in tether.__all__:
12
12
  assert hasattr(tether, symbol)
@@ -32,7 +32,7 @@ from tether.store import (
32
32
  ToolOffender,
33
33
  )
34
34
 
35
- __version__ = "0.2.17"
35
+ __version__ = "0.2.18"
36
36
 
37
37
  __all__ = [
38
38
  "ActionCall",
@@ -344,6 +344,8 @@ async def _async_main(argv: list[str]) -> int:
344
344
  print(json.dumps({"v": api.SCHEMA_VERSION, "id": sid}) if ns.json else sid)
345
345
  return 0
346
346
  rec = harness.create_session(goal)
347
+ # #90: a caller that kills a foreground run on its own timeout still has the id
348
+ print(f"session {rec.id}", file=sys.stderr, flush=True)
347
349
  watcher = asyncio.create_task(
348
350
  watch(
349
351
  harness.store,
@@ -254,7 +254,10 @@ def _live_map(
254
254
  live[key] = turn.obs_id
255
255
  elif turn.role == "assistant" and turn.tool_cmd:
256
256
  argv = _argv(turn.tool_cmd)
257
- if argv[:2] in (["edit", "write"], ["edit", "replace"]) and len(argv) > 2:
257
+ if (
258
+ argv[:2] in (["edit", "write"], ["edit", "append"], ["edit", "replace"])
259
+ and len(argv) > 2
260
+ ):
258
261
  live = {k: v for k, v in live.items() if k[0] != norm(argv[2])}
259
262
  elif _read_path(turn.tool_cmd) is None: # bash, or a shell write via the bash fallback
260
263
  # ponytail: token/substring match; won't catch paths built at runtime
@@ -179,6 +179,30 @@ def unescape_literal_newlines(stdin: str | None) -> str | None:
179
179
  return stdin
180
180
 
181
181
 
182
+ def _as_edit(tokens: list[str], stdin: str | None) -> tuple[list[str], str | None] | None:
183
+ """A plain shell file read/write as `edit`, for a session with `edit` and no `bash`.
184
+
185
+ `cat p` -> `edit view p`; `echo t > p`, `printf t > p`, `cat > p` + heredoc -> `edit write p`
186
+ (`>>`: `edit append p`).
187
+ qwen3.5:9b spent 10 of 13 steps on `echo ok > hello.txt` and friends with only `edit` on.
188
+ """
189
+ if tokens[:1] == ["bash"]:
190
+ tokens = tokens[1:]
191
+ if len(tokens) == 2 and tokens[0] == "cat":
192
+ return ["edit", "view", tokens[1]], stdin
193
+ if len(tokens) < 3 or tokens[-2] not in (">", ">>"):
194
+ return None
195
+ verb, words, path = tokens[0], tokens[1:-2], tokens[-1]
196
+ sub = "write" if tokens[-2] == ">" else "append"
197
+ if verb == "cat" and not words and stdin is not None:
198
+ return ["edit", sub, path], stdin
199
+ if verb == "echo" and stdin is None:
200
+ return ["edit", sub, path], " ".join(words) + "\n"
201
+ if verb == "printf" and len(words) == 1 and stdin is None:
202
+ return ["edit", sub, path], words[0].replace("\\n", "\n").replace("\\t", "\t")
203
+ return None
204
+
205
+
182
206
  def split_cli(cmd: str) -> list[str]:
183
207
  """Split a CLI command string using POSIX shlex with graceful fallback on unclosed quotes."""
184
208
  try:
@@ -265,9 +289,16 @@ class Multiplexer:
265
289
  # A bare shell command (`ls -la`): the sandboxed bash tool runs it, no retry step.
266
290
  name, spec = "bash", self._tools["bash"]
267
291
  clean_cmd = f"bash {clean_cmd}"
292
+ if spec is None and "edit" in self._tools and "bash" not in self._tools:
293
+ if as_edit := _as_edit(tokens, stdin):
294
+ tokens, stdin = as_edit
295
+ clean_cmd, name, args = shlex.join(tokens), "edit", tokens[1:]
296
+ spec = self._tools["edit"]
268
297
  if spec is None:
269
298
  avail = ", ".join(self._tools.keys())
270
299
  hint = f" For shell commands use `bash {clean_cmd}`." if "bash" in self._tools else ""
300
+ if "edit" in self._tools and "bash" not in self._tools:
301
+ hint = " Files: `edit view <path>`, `edit write <path>` with the text in stdin."
271
302
  from tether.tools import ALL_BUILTIN_TOOLS # lazy: tools import this module
272
303
 
273
304
  head = (
@@ -286,7 +317,12 @@ class Multiplexer:
286
317
  # shlex already stripped quotes; hand the shell the original text (#37).
287
318
  args = clean_cmd.split(None, 1)[1:]
288
319
 
289
- if name == "edit" and args[:1] == ["write"] and len(args) > 2 and stdin is None:
320
+ if (
321
+ name == "edit"
322
+ and args[:1] in (["write"], ["append"])
323
+ and len(args) > 2
324
+ and stdin is None
325
+ ):
290
326
  # `edit write f ok`: the words after the path are the content, spacing as typed.
291
327
  parts = clean_cmd.split(None, 3)
292
328
  if len(parts) == 4 and _unquote(parts[2]) == args[1]:
@@ -128,7 +128,7 @@ class StatsReport:
128
128
 
129
129
 
130
130
  _SUBCOMMAND_TOOLS: dict[str, set[str]] = {
131
- "edit": {"view", "write", "replace"},
131
+ "edit": {"view", "write", "append", "replace"},
132
132
  "web": {"search", "fetch"},
133
133
  "mem": {"pin", "unpin", "list", "search", "recall"},
134
134
  "agent": {"spawn", "status", "wait", "query", "read", "send"},
@@ -136,16 +136,20 @@ _SUBCOMMAND_TOOLS: dict[str, set[str]] = {
136
136
  }
137
137
 
138
138
 
139
+ _CD_LEAD = re.compile(r"^(?:bash\s+)?(?:cd\s+\S+\s*(?:&&|;)\s*)+")
140
+
141
+
139
142
  def canonical_tool_command(raw_cmd: str | None) -> str:
140
143
  """Normalize a raw tool command into its canonical `<tool>` or `<tool> <subcommand>` key."""
141
144
  if not raw_cmd:
142
- return "unknown"
145
+ return "(no command)" # a reply without a command, or a worker error (#79)
143
146
  cleaned = raw_cmd.strip().strip("`").lstrip("$>").strip()
144
147
  if cleaned.startswith("tether "):
145
148
  cleaned = cleaned[len("tether ") :].strip()
149
+ cleaned = _CD_LEAD.sub("", cleaned) # `cd x && pytest` is a pytest run, not a `cd` (#79)
146
150
  tokens = [tok.strip("\"'") for tok in cleaned.split() if tok.strip("\"'")]
147
151
  if not tokens:
148
- return "unknown"
152
+ return "(no command)"
149
153
  head = tokens[0]
150
154
  if head in _SUBCOMMAND_TOOLS and len(tokens) >= 2 and tokens[1] in _SUBCOMMAND_TOOLS[head]:
151
155
  return f"{head} {tokens[1]}"
@@ -3,6 +3,7 @@
3
3
  from __future__ import annotations
4
4
 
5
5
  import re
6
+ from pathlib import Path
6
7
 
7
8
  from tether.decorator import ToolSpec, build_tool_spec
8
9
  from tether.sandbox import SandboxPolicy
@@ -10,6 +11,17 @@ from tether.sandbox import SandboxPolicy
10
11
  # `<tests> 2>&1 | head -N` cuts the runner's summary (it prints last) and hides its exit code.
11
12
  _HEAD_PIPE = re.compile(r"(?P<cmd>.+?)\s*\|\s*head(?:\s+-n)?(?:\s+-?(?P<n>\d+))?\s*", re.DOTALL)
12
13
  HEAD_TAIL_LINES = 6
14
+ # `cd /testbed && <cmd>`: models assume a container path, but the shell starts in the workspace
15
+ _CD_PREFIX = re.compile(r"cd\s+(?P<dir>\S+)\s*(?:&&|;)\s*(?P<rest>.+)", re.DOTALL)
16
+
17
+
18
+ def _missing_cd(cmd: str, root: Path) -> tuple[str, str] | None:
19
+ """(dir, rest) of `cd <dir> && <rest>` when <dir> does not exist, else None (#79)."""
20
+ m = _CD_PREFIX.fullmatch(cmd)
21
+ if not m:
22
+ return None
23
+ path = root / m["dir"].strip("'\"") # an absolute dir replaces root
24
+ return None if path.is_dir() else (m["dir"], m["rest"])
13
25
 
14
26
 
15
27
  def _test_head(cmd: str) -> tuple[str, int] | None:
@@ -45,9 +57,14 @@ def make_bash_tool(sandbox: SandboxPolicy) -> ToolSpec:
45
57
  cmd_str = " ".join(args).strip()
46
58
  if not cmd_str and not stdin:
47
59
  return f"Error: missing `<command>`.\n{help_str}"
60
+ note = ""
61
+ if cd := _missing_cd(cmd_str, Path(sandbox.workspace_root)):
62
+ # qwen3.5:9b lost a step to `cd /testbed && ...` in 3 of 6 paasio runs
63
+ cmd_str = cd[1]
64
+ note = f"[`cd {cd[0]}` skipped: no such directory; commands run in the workspace]\n"
48
65
  if stdin is None and (head := _test_head(cmd_str)):
49
- return _keep_summary(await sandbox.execute_bash(head[0]), head[1])
50
- return await sandbox.execute_bash(cmd_str, stdin=stdin)
66
+ return note + _keep_summary(await sandbox.execute_bash(head[0]), head[1])
67
+ return note + await sandbox.execute_bash(cmd_str, stdin=stdin)
51
68
 
52
69
  return build_tool_spec(
53
70
  _bash,