From 2f429aae8468f249dd40baaf815975d5e02b1030 Mon Sep 17 00:00:00 2001 From: t Date: Thu, 3 Sep 2026 07:41:51 -0600 Subject: Show full subagents.lua source when expanded; guide toward templated prompts 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 Claude-Session: https://claude.ai/code/session_01ETqhv5FVD8Z14BEBsXeHHC --- spec/test_progress.lua | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'spec/test_progress.lua') 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) -- cgit v1.3