Repository navigation
Conversation
… (ENG-15627 §5b) The process tool's `kill` and `remove` success paths returned details.status:"failed", and the SIGKILL fallback recorded the session as "failed". isToolResultError treats "failed" as an error, so a deliberate, successful agent-requested teardown rendered "⚠️ 🧰 Process failed" in the channel — reporting the mechanical outcome with no knowledge of the agent's intent (the operation-outcome-vs-session-state problem in the ENG-15627 spec §5b). - kill success → details.status:"completed" (was "failed"); a genuine inability to terminate still returns via failText earlier. - remove success → details.status:"completed" (was "failed"). - SIGKILL fallback records the session as "killed" (agent-requested), not "failed", on both paths. Tests assert isToolResultError(result) === false for successful kill/remove (the exact predicate that drives the⚠️ banner) and that the fallback records status:"killed". The genuine-failure paths (no pid, not backgrounded) still return failed. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
I'll analyze this and get back to you. |
Author
|
Superseded by #53 — consolidated with the G4 non-terminal-tool-error fix into one reviewable unit (both are the same §5b operation-outcome theme). |
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.

Related: ENG-15627 (§5b — operation-outcome vs session-state)
What Problem This Solves
Fixes an issue where an agent that intentionally kills or removes a background process it started sees "⚠️ 🧰 Process failed" in the chat channel — for a deliberate, successful teardown. As Mona flagged: the runtime reports the mechanical outcome of one operation with zero knowledge of the agent's intent. A successful, agent-requested termination is not a failure, but it was labeled one.
Why This Change Was Made
The⚠️ banner — treats
processtool'skillandremovesuccess paths returneddetails.status: "failed", and the SIGKILL fallback recorded the session as"failed".isToolResultError— the exact predicate that drives the"failed"as an error, so the deliberate teardown surfaced as a failure.killsuccess →details.status: "completed"(was"failed").removesuccess →details.status: "completed"(was"failed")."killed"(agent-requested) rather than"failed"on both paths — more truthful, andkilledremains a non-success status for later poll/status views (unchanged there, no regression).failText→failed.Scoped: this is the concrete, highest-signal instance of the §5b operation-outcome model. The full
OperationOutcometype (disposition/agency/terminality) and deleting thehelperstext-sniffing are a larger follow-up; this fixes the specific customer-visible lie now.User Impact
An agent tearing down its own backgrounded session (e.g. after a long-running command finishes, or cancelling a tunnel/dev-server) no longer emits a false "⚠️ Process failed" to the user. Real failures are unchanged.
Evidence
killandremove, asserted viaisToolResultError(result) === false— the same predicate that renders thestatus: "killed".agents-toolsshard green (989 tests); process suites (20 tests) green; oxlint clean.🤖 Generated with Claude Code
Summary by cubic
Marks agent‑requested kill/remove of background processes as successful instead of failed, preventing the false “⚠️ 🧰 Process failed” banner. SIGKILL fallback now records “killed”; genuine failures are unchanged. Addresses ENG-15627 §5b by aligning operation outcome with agent intent.
killsuccess returnsdetails.status: "completed"(was"failed").removesuccess returnsdetails.status: "completed"(was"failed")."killed"(not"failed").isToolResultError(result) === falsefor successful kill/remove and verify fallback state.Written for commit 4955b22. Summary will update on new commits.