feat(robomp): resume needs-info issues
This commit is contained in:
@@ -23,6 +23,7 @@ IssueState = Literal[
|
||||
"opened",
|
||||
"merged",
|
||||
"closed",
|
||||
"needs_info",
|
||||
"abandoned",
|
||||
]
|
||||
|
||||
|
||||
@@ -405,17 +405,15 @@ def _run_pre_publish_bun_check(
|
||||
_raise_command(msg)
|
||||
|
||||
|
||||
_AUTOCLOSE_INELIGIBLE_STATES: frozenset[str] = frozenset({"closed", "merged", "abandoned"})
|
||||
_AUTOCLOSE_INELIGIBLE_STATES: frozenset[str] = frozenset({"closed", "merged", "needs_info", "abandoned"})
|
||||
_NEEDS_INFO_LABEL = "needs-info"
|
||||
|
||||
|
||||
def _should_schedule_autoclose(bindings: ToolBindings, target_number: int) -> float | None:
|
||||
"""Return the configured close window (hours) when this comment should
|
||||
schedule an auto-close; ``None`` otherwise.
|
||||
|
||||
Conditions: feature enabled in `Settings`, the comment lands on the
|
||||
originating issue (not a different number, not a PR thread), the issue is
|
||||
classified as `question`, and the issue is not already in a terminal
|
||||
state (closed/merged/abandoned).
|
||||
schedule the question auto-close job: feature enabled, same issue,
|
||||
classified as `question`, and the issue is not already in a terminal or
|
||||
waiting-for-reporter state.
|
||||
"""
|
||||
settings = bindings.settings
|
||||
if settings is None or not settings.question_autoclose_enabled:
|
||||
@@ -888,9 +886,22 @@ def _build_mark_unable(bindings: ToolBindings) -> HostTool[Any, Any]:
|
||||
except GitHubError as exc:
|
||||
_audit(bindings, "mark_unable_to_reproduce", args, error=str(exc))
|
||||
_raise_command(f"GitHub rejected comment: {exc.status} {exc.message}")
|
||||
bindings.db.set_issue_state(bindings.issue_key, "abandoned")
|
||||
_audit(bindings, "mark_unable_to_reproduce", args, result={"comment_id": comment.id})
|
||||
return f"posted abandonment comment id={comment.id}"
|
||||
result: dict[str, Any] = {"comment_id": comment.id, "state": "needs_info"}
|
||||
try:
|
||||
labels = _run_coro(
|
||||
bindings.loop,
|
||||
bindings.github.add_issue_labels(bindings.repo.full_name, bindings.issue.number, [_NEEDS_INFO_LABEL]),
|
||||
)
|
||||
result["labels"] = list(labels)
|
||||
except GitHubError as exc:
|
||||
# Some repos have not created the optional status label yet. The
|
||||
# durable behavior is the non-terminal sqlite state plus the visible
|
||||
# info-request comment, so label setup must not block resumption.
|
||||
log.warning("needs-info label failed", extra={"issue": bindings.issue_key, "err": str(exc)})
|
||||
result["label_error"] = f"{exc.status} {exc.message}"
|
||||
bindings.db.set_issue_state(bindings.issue_key, "needs_info")
|
||||
_audit(bindings, "mark_unable_to_reproduce", args, result=result)
|
||||
return f"posted needs-info comment id={comment.id}"
|
||||
|
||||
return host_tool(
|
||||
name="mark_unable_to_reproduce",
|
||||
|
||||
@@ -61,7 +61,7 @@ description = "Persist a reproduction transcript (command, output, exit code) fo
|
||||
reproduced = "True when the recorded run demonstrates the bug."
|
||||
|
||||
[mark_unable_to_reproduce]
|
||||
description = "Close the loop without a PR: comment with diagnosis + info request, mark issue abandoned."
|
||||
description = "Ask the reporter for missing reproduction details, mark the issue `needs_info`, and keep the session resumable for the next reply."
|
||||
|
||||
[abort_task]
|
||||
description = "Irrecoverably abandon this task WITHOUT posting any visible message. Use ONLY for orchestrator/environment defects you cannot work around (broken filesystem permissions, missing system tools, corrupted git metadata, harness bugs). NEVER for normal workflow problems — failed builds, missing repro info, unclear requests use `gh_post_comment` or `mark_unable_to_reproduce` instead. `reason` is audit-only and NEVER shown to the reporter."
|
||||
|
||||
@@ -5,3 +5,5 @@
|
||||
## Information needed
|
||||
|
||||
{{info_needed}}
|
||||
|
||||
I'll keep this issue waiting on reporter details and resume from this context when the requested information arrives.
|
||||
|
||||
Reference in New Issue
Block a user