Repository navigation
[TH-9454] fix: follow-ups from #245's last review of the agent reading - #282
Merged
khushalsonawat merged 13 commits intoNov 11, 2026
Merged
khushalsonawat merged 13 commits into
khushalsonawat merged 13 commits into
Conversation
…efore the platform (TH-9491) These fail until the fix lands. Refs: TH-9491 Signed-off-by: khushalsonawat <khushalsonawat@gmail.com>
…hat the kit sends and stores (TH-9491) The kit writes an agent's prompt, rules, summary and notes in its own words. That text can hold a web address with a password or key in it, and until now it reached the platform as written. After this change, every web address in that text loses its username, password, query and fragment wherever the kit saves or sends it. - providers/agent.py: _redact also cleans addresses inside prose. Every :// starts an address, and an address runs to the next whitespace, so no guessed end can leave a key behind. - contract.py: one writer for contract.json. Each description field is marked as free text, which is cleaned, or technical, which is kept as written. A test fails if a field is unmarked, or if a module writes contract.json without going through the writer. - Send-time guards re-clean before each send, for descriptions saved by older versions: the provision payload (_chosen_evals_and_prompt), the suite evals' agent_prompt, the judge's instructions, the live run view, the grade calls, emit_model_event, and cli._render's stdout. - hosted_chat_entrypoint.py: the hosted builder's chat events are cleaned, covering the streamed deltas, assistant_message, tool_result, artifact paths and the question prompt. Deltas go through a bounded holdback: text since the last whitespace is held; past 4,096 characters, everything before the last address start is sent; past 16,384, the address becomes [redacted]. amend's rule echo and cli's authoring drain are cleaned too. Known limits, each owned elsewhere: - traces: TH-9504. - bare keys, path tokens, file contents, whitespace inside a password, and an address broken by a line break or tab in a sentence: TH-9500. - the builder's transcript mirror, coordinator_state, remember notes and request_adjustment: TH-9532. - the model's files in the workspace checkpoint archive: TH-9521. Reviewed in three plan rounds and three change rounds, followed by a fix-only check by two fresh reviewers, as the Coordinator ruled after round 3. Both reviewers were CLEAR, and their Mediums are fixed here. Refs: TH-9491 Signed-off-by: khushalsonawat <khushalsonawat@gmail.com>
Signed-off-by: khushalsonawat <khushalsonawat@gmail.com>
TH-9491's redaction property tests in tests/providers/test_providers_agent_build.py import hypothesis, which the clean-install job did not install, so collection failed. Install it at the dev group's minimum, the same pin as pyproject.toml. Refs: TH-9491 Signed-off-by: khushalsonawat <khushalsonawat@gmail.com>
- The reading refuses exactly the jobs the build loads a profile for. One rule, provider_profile_source in job.py, is now shared by the reading's job check and the build's _load_provider_import_profile. A connect_only job on a connector with no provider profile (auto, http) is now read. Phone and LiveKit connect_only stay refused, because the build adds their pasted prompt to what it reads. - test_nothing_is_saved_after_the_soft_limit_decides waits for the reading's decision instead of a fixed 1.5 s, so a loaded machine can no longer make it fail. - Before the reading returns, it cancels every other task on its loop (_stop_the_rest, the first line of _read's finally). So a late tool call can no longer replace contract.json, or write failure.json beside agent.json, after the reading has decided. Tests pin every ending, the contract save's cancel at each of its waits, and the reading's Gemini tools running on its loop. Reviewed: design review, plan review and one change review round, each by two fresh reviewers, all CLEAR. Their Mediums are fixed here. Refs: TH-9454 Signed-off-by: khushalsonawat <khushalsonawat@gmail.com>
Signed-off-by: khushalsonawat <khushalsonawat@gmail.com>
Signed-off-by: khushalsonawat <khushalsonawat@gmail.com>
cdileep23
approved these changes
Nov 11, 2026
…st guards the shared rule (TH-9454) Answers Dileep's two review comments on #282: - test_a_late_save_after_a_cancel_that_escapes_the_turn_is_cancelled patches agent_reading.document with monkeypatch instead of assigning it by hand, and its docstring drops the review tag. - the agreement test's docstring says it only checks that the build still uses the shared rule; the refused-pairs table is the guard on the rule itself. Refs: TH-9454 Signed-off-by: khushalsonawat <khushalsonawat@gmail.com>
… into TH-9491 - tools.py: _save_contract keeps the single writer (write_contract) and takes #268's new reply text, which names unconfirmed prompt lines. - contract.py: #268's new fields, unconfirmed_prompt_from and model (ModelSource), are marked as kept as written: they hold source lines and the cited model name, read by the build. The test that fails on an unmarked field caught them. Signed-off-by: khushalsonawat <khushalsonawat@gmail.com>
…288) into TH-9491 - tests/test_harness_sandbox_server.py: both sides appended tests; kept both. - test_contract_writer's allow-list gains #269's two contract.json copies: reading_result.document's replace_if_unchanged (the saved contract's own bytes plus the reading record) and seed_contract.use_seed's _write_whole (the platform's seed, as written). - sandbox_server.py imports SecretResolutionError, which #284's resolver raises but the base never imports: seven sandbox-server tests fail with NameError on the base itself. Signed-off-by: khushalsonawat <khushalsonawat@gmail.com>
khushalsonawat
merged commit Nov 11, 2026
71776fa
into
feat/TH-8804-source-subfolder
11 checks passed
6 of 8 tasks
khushalsonawat
added a commit
that referenced
this pull request
Nov 11, 2026
…t/TH-9512-past-the-parse-total Signed-off-by: khushalsonawat <khushalsonawat@gmail.com>
15 of 16 tasks
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.
Review only commit 2d2a794, the one after 1bd1023 (#278's head). This PR is stacked on #278, which is stacked on #271. Their commits show here until they land.
Description
These are three follow-ups left by #245's last review, for the read-only agent reading (TH-8951). None changes anything the platform sees today.
Type of Change
Changes
provider_profile_sourceinjob.py, is now shared by the reading's job check and the build's_load_provider_import_profile. The reading refuses exactly the jobs the build would load a profile for, whether from a provider's API or from the job's own settings.connect_onlyjob on a connector with no profile (auto,http) is now read, not refused. The platform never sends one.connect_onlystay refused, because the build adds their pasted prompt to what it reads.PROVIDER_MANAGED_CONNECTORSmoves tojob.pyand is re-exported fromauthoring_entrypointforauthoring_runtime_validation.py's lazy import.connect_only+autoreading.test_nothing_is_saved_after_the_soft_limit_decideswaits for the reading's decision instead of a fixed 1.5 s. With the event loop held for 1.4 s, the old test failed 5 of 5 runs. It is now a probe of the reading's cancel of the AI's turn._stop_the_rest()is the first line of_read'sfinally. It cancels every other task on the reading's loop before the reading returns, so a late tool call can't replacecontract.json, or writefailure.jsonbesideagent.json, after the reading has decided.submit_contractcancelled at each of its waits, which writes nothing;tool_thread_pool_configapplies only to live mode in 2.7.1, which the reading doesn't use.Known limits
Pending Khushal's OK
provider_import, orconnect_onlyon vapi, retell, retell_chat, phone or livekit. It refuses these asreading_job_invalid(78), because the build adds that profile to what it reads and a reading never loads it."connect_onlyjob whose connector has no provider profile (auto,http). The platform never sends one, so nothing changes for TH-8824."Testing
Each test file ran on its own:
test_agent_readingtest_reading_entrytest_agent_scantest_call_runnertest_harness_architecturetest_vertex_gemini_backendThe 16 other files that use the moved rule also passed, among them
test_authoring_runtime_validation(112),test_agent_type_refusal(651) andtest_bundle_author_v2(323). There were no failures anywhere.Planted bugs. Each one-token or one-line break was applied in a scratch copy and turned its named test red:
strip()removed;The reviewers added 8 plants of their own, all caught except one that is an equivalent change.
Stability: the timing-sensitive tests passed 10 of 10 repeat runs.
Review: a design review, a plan review and one change review round, each by two fresh reviewers. All were CLEAR, and their Mediums are fixed in this commit.
Related Issues
Refs: TH-9454