AITURK IDE 1.0.0-beta.18: gorunmeyen onay beklemesi yerine aninda "onay gerekli"
A one-shot run (hermes chat --query-file ... -Q, stdin closed, no window)
still installs the prompt_toolkit approval callback but never starts the
prompt UI. The protected instruction-file gate (AGENTS.md / CLAUDE.md /
SOUL.md ...) took the registered callback for a reachable human and waited
out approvals.timeout on a panel painted nowhere. With the profile value of
300000 s the stage job hung for good.
- Gate: in a one-shot run, or when only an automatic approver
(subagent_auto_approve) is attached, return BLOCKED / APPROVAL REQUIRED
immediately instead of prompting. Human consent is still required every
time; yolo and approvals.single_query_mode still do not open this gate.
- One-shot exit prints an "approval_required: {json}" line on stderr
(session_id, tool_call_id, request_id, targets, reason, applied=false)
so the launcher can tell "blocked, needs a human" from "still working".
- execute_code: an approval that arrives after the calling script stopped
waiting (300 s reply timeout, script run timeout, retired kernel cell)
is not applied.
- Same invisible wait removed from the computer_use and memory-write
prompts in a one-shot run. The one-shot marker is no longer inherited by
child processes.
- BLOCKED text no longer breaks on a target path containing braces.
Long-running tools are untouched: no general tool timeout was shortened.
Kart: turkservis-20261007-1421-2
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EwSpve9HuXMy7dHf4RDMzX
This commit is contained in:
1 parent
58dbb4523b
commit
7e4cc0915c
13 files changed
+886
-16
No files matched your search
@@ -1470,6 +1470,34 @@ def _wait_for_oneshot_background_completions(cli) -> None:
|
||||
)
|
||||
|
||||
|
||||
def _emit_approval_required(session_id) -> None:
|
||||
"""Report approvals a one-shot run could not put in front of a human.
|
||||
|
||||
One ``approval_required: <json>`` line per blocked request on stderr,
|
||||
next to ``session_id:``, so the process that launched this run can tell
|
||||
"blocked, needs a human" from "still working" without parsing prose.
|
||||
Nothing was applied for these requests; resuming the same session in an
|
||||
interactive surface is the way to get them approved.
|
||||
"""
|
||||
try:
|
||||
from tools.approval import drain_human_approval_required
|
||||
records = drain_human_approval_required()
|
||||
except Exception:
|
||||
return
|
||||
for record in records:
|
||||
try:
|
||||
if not record.get("session_id"):
|
||||
record["session_id"] = session_id or ""
|
||||
record["resume"] = "interactive"
|
||||
print(
|
||||
"approval_required: "
|
||||
+ json.dumps(record, ensure_ascii=True, sort_keys=True),
|
||||
file=sys.stderr,
|
||||
)
|
||||
except Exception:
|
||||
continue
|
||||
|
||||
|
||||
def _finalize_single_query(cli) -> None:
|
||||
"""Close one-shot CLI resources before releasing the active session lease."""
|
||||
try:
|
||||
@@ -22360,6 +22388,7 @@ def main(
|
||||
|
||||
# Session ID goes to stderr so piped stdout is clean.
|
||||
print(f"\nsession_id: {cli.session_id}", file=sys.stderr)
|
||||
_emit_approval_required(cli.session_id)
|
||||
|
||||
# Ensure proper exit code for automation wrappers.
|
||||
#
|
||||
|
||||
Reference in new issue
Block a user