Repository navigation
fix: report refused agent permits as no input and resolve home from the env HOME - #291
Merged
Merged
Conversation
A human takeover refuses the agent permit before any input is sent. MCP input tools now record that refusal as not-attempted, in the tool result and in evidence, by checking HumanControlActiveError. Closes #284
pickforgeHome and legacyPickforgeHomes now fall back to the HOME of the env object they get when PICKFORGE_HOME is unset or empty, and to os.homedir() only when that HOME is unset or empty. Closes #285
3 tasks done
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.
Two small product fixes.
#284:
withAgentPermitthrowsHumanControlActiveErrorbefore it runs any input. MCP now treats that error like a text preparation failure and records the input asnot-attempted, in the tool result and in the evidence record. A failure after input dispatch began still recordsattempted. Without capture, a failed input now also returns itsinputStatein the tool result, with the error text unchanged. The check is shared by all MCP input tools, so click, double click, drag, scroll, key and focus report a refused permit the same way. The CLIdesktop typepath records no input state, so it is unchanged.#285: when
PICKFORGE_HOMEis unset or empty,pickforgeHome(env)andlegacyPickforgeHomes(env)now use the env object'sHOME, and fall back toos.homedir()when that is missing. Product callers passprocess.envorctx.env. Constructed envs with a privateHOMEonly go to child processes, whoseos.homedir()already followsHOME. So resolved paths do not change for users.Closes #284
Closes #285
desktop_typewith captureafter,both, and none;desktop_clickwith capturenot-attemptedin evidence; captured results reportnot-attempted; no input reached the app~/Artifacts/pickforge-batch2-2026-10-07/qa-284/out2.txt,actions-*.jsonlqa-284/desktop_typewith capturecompleted; text shown in the dialogqa-284/out3.txt,qa-284/qa284.pngdesktop_typeanddesktop_key; every input tool with a preparation failure and a dispatch failureok: falsewithnot-attemptedfor refusal and preparation,attemptedfor dispatchqa-284/r2-out2.txt,qa-284/r2-out3.txtdesktop-input-captures.test.ts: refused permit for all seven input tools with capture;desktop_typerefused without capture; dispatch failure stillattemptedpaths.tsHOME, elseos.homedir()paths.test.ts,pickforge-home-env.test.ts(doctor),session-status.test.ts,home-policy.test.ts; each failed before the fix~/Artifacts/pickforge-batch2-2026-10-07/291-cov-r2.logQA device pass for #285: skipped. A real process's
os.homedir()already follows itsHOME, so the change is not visible from the CLI or MCP. The automated tests cover it.