Repository navigation
fix(host,cli): handle final_answer turns, approval timeouts, and input keys (ENG-405) - #8
Merged
folathecoder merged 2 commits intoOct 18, 2026
Conversation
added 2 commits
October 18, 2026 23:10
…t keys (ENG-405) Suppress Agentling's internal final_answer tool from protocol tool cards and emit its answer as a TextEvent when no TextDelta chunks were streamed. Set timeout=inf on RunCommandTool and SetPersonaTool so Agent.tool_timeout does not expire while waiting on user approval. Unwrap tool arguments before 120-char truncation, preserve tool result summaries on 80-column terminals, bind Ctrl+J and \+Enter to insert newlines, validate OPENAI_API_KEY from the environment on first run, and disable reverse-video toolbars in plain mode.
folathecoder
deleted the
folathecoder/eng-405-81-pre-release-fixes-final_answer-handling-approval-timeouts
branch
October 18, 2026 22:29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the nine issues identified during the Aldwin 0.0.1 pre-release audit and end-to-end PTY review so
ENG-385(Release Aldwin 0.0.1) can begin cleanly. Turns that finish via Agentling's built-infinal_answertool now render their full Markdown answer without showing an internalfinal_answertool card, approval prompts wait indefinitely without being cancelled at 60 seconds byAgent.tool_timeout, long tool rows unwrap JSON before truncation and keepduration · summaryvisible at 80 columns, and\+Enter andCtrl+Jinsert newlines.Ticket
Closes ENG-405
Changes
src/aldwin/host/runner.py):final_answerfromToolCallEventand non-errorToolResultEventinAldwinHost._run_turn, and emitTextEventfromfinal_answerwhen the final step did not streamTextDeltachunks (FR-1).command,url,name,query,text) informat_args_previewbefore truncating at 120 characters (FR-3).src/aldwin/core/tools/run_command.py,src/aldwin/core/tools/persona_tool.py):timeout: float | None = float("inf")onRunCommandToolandSetPersonaToolsoAgent.tool_timeout(60.0s) does not cancelask()while waiting for user approval, leavingRunCommandTool's post-approval 60-second timer in control (FR-2).src/aldwin/cli/):display_argswidth inTurnRenderer.on_tool_resultsoduration · summaryis never clipped on 80-column terminals, and add a truncated-JSON fallback informat_display_args(FR-3,FR-4).Ctrl+J(c-j) and\+Enter (c-m) to insert newlines inbuild_prompt_sessionand update/helpkeybindings (FR-5).OPENAI_API_KEYfromos.environon first run vianeeds_onboarding/run_onboarding(FR-6).PLAIN_PROMPT_STYLE(noreverseonbottom-toolbar) for--plainandNO_COLOR=1(FR-7).(FR-1)fromsetupanduninstall--helpdocstrings, capdisplay_homein the session headerPaneltitle so panels stay<= 76columns, italicizecontinuein colour-mode notices, and remove unusedshort_session_id(FR-8).tests/):TC-01toTC-15) acrosstest_host_runner.py,integration/test_full_turns.py,test_run_command.py,test_persona.py,test_cli_render.py,cli/test_render_suite.py,test_cli_chat.py,test_cli_onboarding.py, andtest_cli_main.py.How it was tested
uv run ruff check src tests(passed)uv run ruff format --check src tests(69 files formatted)uv run mypy src tests(0 issues in 65 source files)uv run pytest --cov=aldwin --cov-report=term-missing --cov-fail-under=90(246 passed, 2 deselected in 4.19s, 92.49% coverage)TC-16):uv build, installed into an isolatedUV_TOOL_DIR, and verifiedaldwin --help, 80-column long tool rows,final_answerMarkdown rendering,\+Enter andCtrl+Jmulti-line input, and--plainmode (0 reverse-video SGR codes).Notes for reviewers
Agent.tool_timeoutremains60.0for non-approval tools (ENG-380 FR-1), whileRunCommandToolandSetPersonaToolopt out of the pre-approval wrapper viatimeout = float("inf").