summaryrefslogtreecommitdiff
path: root/spec/test_progress.lua
diff options
context:
space:
mode:
authort <t@tjp.lol>2026-09-03 07:41:51 -0600
committert <t@tjp.lol>2026-09-03 07:57:03 -0600
commit2f429aae8468f249dd40baaf815975d5e02b1030 (patch)
treebe097a440d02d515fd0059cc127a2a5a660212fb /spec/test_progress.lua
parentb206f895d9d3e82fcd2dc028d993b66ab0734011 (diff)
Show full subagents.lua source when expanded; guide toward templated promptsHEADmain
The expanded progress board capped the executed Lua at 128 lines (and 32KB), so long workflow sources ended in an ellipsis even after Ctrl-O. Expanded now renders the whole source; collapsed still shows the first four lines. Add a "Program, don't transcribe" section to the system guidance so the primary writes shorter sources: one [[template]] with {name} placeholders filled by gsub with a table, loops over data instead of per-child copies, shared system prompts in `agents`, and file references instead of quoted contents. A single templating mechanism is named on purpose to remove choice. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ETqhv5FVD8Z14BEBsXeHHC
Diffstat (limited to 'spec/test_progress.lua')
-rw-r--r--spec/test_progress.lua23
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/test_progress.lua b/spec/test_progress.lua
index 79570c1..a562789 100644
--- a/spec/test_progress.lua
+++ b/spec/test_progress.lua
@@ -349,6 +349,29 @@ return {
progress.reset()
end },
+ { "expanded subagents.lua source is never truncated", function()
+ if not pcall(require, "dkjson") then return "skip", "dkjson is not installed" end
+ progress.reset()
+ local lines = {}
+ for i = 1, 600 do lines[i] = "local v" .. i .. " = " .. i end
+ lines[#lines + 1] = "return 'last-line'"
+ local component
+ progress.claim({
+ id = "call-long-source",
+ tool_name = "subagents.lua",
+ collapsed = false,
+ input = require("dkjson").encode({ source = table.concat(lines, "\n") }),
+ set_component = function(_, value)
+ component = value
+ return { invalidate = function() end, alive = function() return true end }
+ end,
+ })
+ local rendered = component:render(100)
+ assert(rendered[#rendered] == " return 'last-line'", rendered[#rendered])
+ assert(#rendered == 2 + #lines, #rendered)
+ progress.reset()
+ end },
+
{ "expanded history includes streamed assistant text and available tool call fields", function()
progress.reset()
local component = board("call-tools", false)