Resolve merge conflicts across PRs #32, #35, #36, #37, #38 via targeted patch application#40
Merged
Merged
Conversation
- PR #36: setup version override (already applied) - PR #35: delegate canonical action (already applied) - PR #37: web-fetch binary refusal + tests - PR #38: edit-loop guard, self-authored tagging, bash banner, markdown churn guard + tests - PR #32: secret redaction at tool ingestion (agent_session.py) + secret-bearing path guard in agent_tools.py + tests
Copilot created this pull request from a session on behalf of
abdoelsayed2016
May 29, 2026 01:09
View session
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.
Five open PRs from a fork diverged ~169 commits behind HarnessLab's
main, making direct merge impossible. Changes were cherry-picked or manually ported, adapting for files that exist only in the fork (agent_state_machine.py,state_machine_operators.py,tui.py).Changes by PR
PR #36 — Setup version override
run_setup()now accepts an optionalcurrent_versionparameter, enabling test overrides without live version detection.PR #35 — Delegate action key fix
_execute_delegate_agentmetadata now emits'action': 'delegate_agent'(was'action': 'Agent').PR #37 — Web-fetch binary refusal (
src/agent_tools.py)_web_fetch()inspectsContent-Typeand response bytes; refuses with a clear error rather than returning binary garbage to the model.PR #38 — Reasoning-pattern guards (
src/agent_tools.py)Four guards targeting the tweak-and-rerun failure mode observed in the Latti S127 transcript:
_track_write_and_check_loop: hard-refuses after 5 writes/edits to the same resolved path per context lifetime_read_fileprepends[self-authored: ...]header when reading a file the agent wrote earlier in the session_bash_self_authored_banner: prepends the same skepticism header to stdout when the command references a self-authored file_track_churn_and_check: refuses after 4 summary/findings-shaped.mdwrites (keyed off filename patterns;README/CHANGELOG/docs/allowlisted)ToolExecutionContextgainsedit_history: dict[str, int]andself_authored_paths: set[str]fields (mutable containers inside afrozen=Truedataclass — intentional).PR #32 — Secret redaction at tool ingestion (
src/agent_session.py,src/agent_tools.py)redact_secrets()and_SECRET_PATTERNS(8 token families: Anthropic/OpenAI, Stripe, GitHub, AWS, Slack, Google API, JWT, PEM) inlined directly intoagent_session.pysinceagent_state_machine.pydoesn't exist in this repo. Called at all four ingestion points so aReadof a.envfile doesn't poison message history:_read_file,_edit_file, and_grep_searchinagent_tools.pygain a pre-emptive_refuse_if_secret_bearing()check against known secret-file path patterns (.env,id_rsa,.aws/credentials,*.pem, etc.), resolving symlinks before matching.Test files added
tests/test_web_fetch_binary_refusal.pytests/test_edit_loop_and_self_authored.pytests/test_churn_and_bash_banner.pytests/test_secret_redaction_on_tool_ingestion.pytests/test_agent_tools_secret_path_guard.pyTests from the fork that depended exclusively on
agent_state_machine.State/Action/violates_constitutional_wallorstate_machine_operators.ReadFileOperatorwere omitted as those abstractions don't exist here.