From eb8a78baafa4556fde11cddda4740fe4b733cf31 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Tue, 2 Dec 2025 11:09:56 -0500 Subject: jr: add 'prompt' command to inspect agent system prompt jr prompt constructs and prints the full system prompt that would be sent to the agent, including: - Agent configuration (model, cost budget) - Base instructions - AGENTS.md content - Relevant facts from knowledge base - Retry/progress context if applicable Useful for debugging agent behavior and token usage. --- Omni/Jr.hs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'Omni/Jr.hs') diff --git a/Omni/Jr.hs b/Omni/Jr.hs index c35efa3..b60a029 100755 --- a/Omni/Jr.hs +++ b/Omni/Jr.hs @@ -54,6 +54,7 @@ jr Usage: jr task [...] jr work [] + jr prompt jr web [--port=PORT] jr review [] [--auto] jr loop [--delay=SECONDS] @@ -67,6 +68,7 @@ Usage: Commands: task Manage tasks work Start a worker agent on a task + prompt Show the system prompt that would be sent to the agent web Start the web UI server review Review a completed task (show diff, accept/reject) loop Run autonomous work+review loop @@ -94,6 +96,21 @@ move args Just p -> fromMaybe Web.defaultPort (readMaybe p) Nothing -> Web.defaultPort Web.run port + | args `Cli.has` Cli.command "prompt" = do + case Cli.getArg args (Cli.argument "task-id") of + Nothing -> do + IO.hPutStrLn IO.stderr "Error: task-id is required" + Exit.exitFailure + Just tidStr -> do + let tid = Text.pack tidStr + tasks <- TaskCore.loadTasks + case TaskCore.findTask tid tasks of + Nothing -> do + IO.hPutStrLn IO.stderr ("Error: task not found: " <> tidStr) + Exit.exitFailure + Just task -> do + prompt <- AgentWorker.buildFullPrompt task + putText prompt | args `Cli.has` Cli.command "work" = do -- Always run in current directory let path = "." -- cgit v1.2.3