Repository navigation
feat(tier3): add tier3 feedback chat over a completed run - #341
Merged
Merged
Conversation
chat(messages) takes an OpenAI-style history: optional leading system messages, then user and assistant turns. completions() now calls the same private _complete_messages helper with one user turn, so both paths share the retries, the typed refusal, truncation and empty-reply errors, the Anthropic server-side fallback headers and the ADC token refresh. Anthropic receives the system text in its separate system field; Bedrock and OpenAI-compatible endpoints receive it as a leading system message. An invalid history raises LLMClientError before any client is created. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
`skillevaluator tier3 feedback RUN_DIR [--skill PATH]` opens a terminal chat about one completed Tier 3 run. Answers are grounded in the run's scores, with-skill and baseline comparisons, measured agent tokens and seconds, execution errors, every case's attempts with per-metric scores, and the report feedback saved in result.json when its run_id names the run directory. The payload is built without a second judge call. The skill is inferred from the run's publication target; an explicit --skill must match it (NFC, case-insensitive), and a changed skill digest is pointed out. Each question sends compact evidence to the configured provider with the run ID instead of its host path and with credential- shaped text redacted. Model text is printed literally with terminal controls removed. Failed turns print a sanitized message and leave the history unchanged; Ctrl-C discards the current question. No request is sent before the first question, empty stdin exits 0, and the command exits 1 when every question failed. Nothing is written to disk. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
rng1995
commented
Nov 4, 2026
rng1995
left a comment
Collaborator
Author
There was a problem hiding this comment.
Automated review: 4 findings (0 P1, 1 P2, 3 P3); 4 posted inline.
Warnings, execution errors, case questions and ground truth, dimension explanations and saved feedback were cut to their limits before the run path was replaced and credentials were redacted. A token or path that crossed the limit lost the part a redaction pattern needs, and its prefix reached the provider. Each string now has the run path replaced with the run ID and goes through redact_sensitive_text with max_len and a bounded input window, as the plugin evidence helpers do, before it is shortened. The final pass over the whole context stays for fields that are never shortened. A dimension explanation that is not text is dropped instead of sliced. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Case rows were kept in agent order until the 300,000-character budget ran out, so a large multi-agent run could send every case for the agents that sort first and none for the last one. cases_omitted was one number and did not say whose cases were missing. The budget is now spent one case at a time across agents, so each agent keeps the same leading cases. Kept rows are still listed by agent and case, and cases_omitted counts the rows left out per agent. The system prompt asks the model to say which agent's cases are missing. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
tier3 checks its registered commands before it treats the first argument as a skill path, so `tier3 feedback` opens the chat even when the current directory has a skill folder named feedback. The tier3 feedback section now says to run `tier3 ./feedback` or `tier3 evaluate feedback` to evaluate that skill, and a test pins both routes. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Restore the two long monkeypatch.setattr lines in the Vertex ADC tests as they are on main. Wrapping them belongs to the open change that reformats this file; this branch only adds the chat tests. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Each shortened field is masked over a window of limit * 4 + 256 characters, cut back to the window's last whitespace so a credential split at the edge is dropped. Text with no whitespace after its limit, such as a compact JSON ground truth or a minified provider error, was cut back to its last space or to nothing. The model saw an empty ground truth or error with no sign that text was left out. Such text is now masked over a 65,536-character window instead, so it keeps a masked prefix up to its limit. When a window still drops text, the field ends in ...<truncated>, the same marker as other shortened fields. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
The feedback chat replaced only the run directory's current path with the run ID. A run copied from another machine keeps its ID, and its errors and warnings still name the original location, for example /home/<user>/work/<skill>/evals/results/<run_id>/jobs/t1. That path, with the user and skill names in it, reached the provider unchanged. JSON-escaped Windows paths and other spellings of the same directory were missed too. Any absolute path (POSIX, home, UNC or drive letter, escaped or not) that ends in a path segment equal to the run ID is now replaced with the ID. The path starts at the first absolute-path root after the preceding whitespace or quote, so a prefix such as --output= is kept. Relative paths and names such as <run_id>_old or <run_id>.log are left as they are. The scan is linear in the text length. The CLI reference now says which paths are replaced, that a path from another machine containing a space is not recognized, and that a shortened field ends in ...<truncated>. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
rng1995
marked this pull request as ready for review
November 5, 2026 18:29
rng1995
requested review from
chrisknvidia,
mosheabr and
rmalani-nv
as code owners
November 5, 2026 18:29
Conflicts: src/skillevaluator/inference/client.py and tests/inference/test_llm_client.py. Kept both sides; the model_used reset from main now runs at the start of _complete_messages, so chat() and completions() both record provenance. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
main's model provenance (#308) leaves LLMClient.model_used as None after a failed call. chat() validated the history before _complete_messages cleared it, so an invalid history raised LLMClientError while model_used still named the model from the previous call. chat() now clears it first; no client is created, so an invalid history still fails before any provider call. The model_used and chat() docstrings name chat() too. A new provenance test checks that chat() reports the server-side fallback model after a success and None after an empty history. It fails without this change. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Collaborator
Author
|
Post-merge review: 4 finding(s) (P3). Follow-up PR: #364.
🤖 Generated with Claude Code |
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.
Summary
skillevaluator tier3 feedback RUN_DIR [--skill PATH]. It opens a terminal chat about one completed Tier 3 run, so a skill author can ask follow-up questions and get advice on skill changes without running the evaluation again or calling the Insights judge again.resources), and one row per agent and dataset case with every with-skill and baseline attempt and its per-metric scores. The report feedback saved inresult.json(tier3_feedback, schema 1.0) is included only when that file'srun_idnames the run directory.agent_eval_result_from_directory(use_llm_judge=False, enforce_embedded_size=False), so there is no second judge call and every agent's trials are kept.result.jsonpublication_target.skill_namewhen itsrun_idmatches the directory, otherwiseskill_name. An explicit--skillmust name that skill, compared on the NFC name and ignoring case, so a decomposed (NFD) macOS path still matches. When the skill's digest differs from the recordedpublication_target.skill_digest, the chat says the skill has changed since the run.redact_sensitive_textpass covers the fields that are never shortened.~/, UNC and drive-letter paths, escaped or not, that end in a segment equal to the run ID. A prefix such as--output=is kept. Relative paths and names such as<run_id>_oldor<run_id>.logare left alone. A path from another machine that contains a space is not recognized, and the docs say so....<truncated>. Text with no whitespace after its limit, such as a compact JSON ground truth or a minified provider error, is masked over a 65,536-character window, so it keeps a masked prefix up to its limit instead of being blanked.cases_omitted(for example{"opencode": 31}), and the system prompt asks the model to say whose cases are missing.llm_failure_diagnosticfor SDK errors such as HTTP 401), never a provider response body, and the chat keeps running.Textafterstrip_terminal_controls, never as Rich markup. Run and skill paths in the panel are printed literally too.exit,quit,q,:qor Ctrl-D end the chat. Ctrl-C during an answer discards that question.LLMClient.chat(messages)adds multi-turn requests.completions()now calls a shared_complete_messages(system, turns)helper with one user turn, so both paths use the same retries, typed refusal/truncation/empty-reply errors, Anthropic server-side fallback headers and ADC token refresh. Anthropic gets the system text insystem=, while Bedrock (litellm) and OpenAI-compatible endpoints get it as a leading system message. An invalid history raisesLLMClientErrorbefore any client is created.TIER3_FEEDBACK_CHAT_MODEL,_MAX_TOKENS,_TEMPERATUREand_REASONING_EFFORTalias the Insights judge settings. As with the judge,SKILL_EVAL_LLM_PROVIDERandSKILL_EVAL_LLM_MODELselect the provider and model.tier3 feedbacksection, a command-map row and thetier3member list indocs/cli-reference.mdx. The section says thattier3 feedbackalways opens the chat, so a skill folder namedfeedbackis evaluated withtier3 ./feedbackortier3 evaluate feedback. There is also a short entry under "Browse results" indocs/reports.mdx, a pointer after viewing results indocs/tier3-live-evaluation.mdx, and a CHANGELOG entry under Unreleased > Added.Why
After a live run, the report says what happened, but turning that into a skill change usually needs follow-up questions, for example "Which cases explain the lower score?" or "What should I change if agent time matters more than token cost?". Today the only way to get new advice is to run the evaluation again. The chat answers these questions from the evidence the run already saved and treats proposed changes as hypotheses for the next run.
Kept from public
_checked_contentand_extract_choice_content(LLMClientRefusedError,LLMClientTruncatedError,EmptyLLMResponseError) is reused bychat()and not duplicated. The same goes forretry_call_with_backoff, the Claude 5.5+ server-side fallback on native Anthropic endpoints and the ADC refresh. Request kwargs forcompletions()are unchanged.llm_failure_diagnostic, so the client gets no second error mapping.utils/rich_markup.strip_terminal_controls, andrich_markupis unchanged. A DCS payload such asESC P q#0 ESC \loses its escape bytes and shows the inert payload as plain text, as everywhere else in the CLI.tier3_report._run_truth_metadata:result.jsonis bound byrun_id == run_dir.nameand not by the absoluterun_dir, so a copied run keeps its saved feedback. The saved-feedback binding lives in the new module, andtier3_report.pyis not edited.publication_identity.publication_target_nameandpublication_target_from_path. Completed runs are detected withrun_directory_sort_key(require_completed_result=True). Provider checks useresolve_llm_provider/ProviderConfigurationError.redact_sensitive_texton string values. Key-basedredact_sensitive_datawould also blank the measuredtokenstotals. Shortened fields call it with the boundedmax_input_charswindow used bytier3/plugin_evidence.py, which drops a token cut at the window's edge.what_to_fixalready reach the chat through the saved feedback'srecommendations, so they are not read a second time.run_feedback_chatis exported fromtier3/commands.pybut is not added to the lazytier3/__init__.pyexport list.Tests
tests/evaluation/test_tier3_feedback_chat.py(57 tests). It fails onmainat collection, because the module does not exist there. It covers:--skillchecks, case and NFD spellings...<truncated>Downloads, and the evidence names/home/ci-runner/...,C:\Users\...(plain and JSON-escaped) and~/...paths ending in the run ID; each becomes the ID, and apath=prefix and the part after the run ID are kept; a relative path,<run_id>_oldand<run_id>.logare unchangedopenai.AuthenticationErrorfollowed by a working turnfeedback(tier3 feedbackopens the chat;tier3 ./feedbackandtier3 evaluate feedbackevaluate the folder), literal model text, provider misconfiguration before the first question, incomplete run, mismatched skill, escape stripping, Ctrl-C, bracketed paths, EOF exits 0 with no client created, alternating history for a real run, exit 1 when every question fails, and the changed and unchanged skill noticetests/inference/test_llm_client.py::TestChat(14 tests): empty and invalid histories rejected before a client exists; OpenAI-compatible, Anthropic (system split out, fallback headers kept) and Bedrock requests; no system message;completions()still sends one system and one user message; truncation raised as a typed error and not retried; empty choices raiseEmptyLLMResponseError. Onmain, 13 of them fail and thecompletions()guard passes.tests/golden/cli_surface.jsongains thetier3 feedbackentry.tests/evaluation/test_tier3_feedback_chat.py,tests/inference,tests/golden,tests/test_cli.py,tests/test_commands.py,tests/test_llm_client_retry.py,tests/test_llm_judge.py,tests/test_retry_provider_transport.py,tests/test_tier3_compare.py,tests/test_tier3_progress.py,tests/test_evaluation_service.py,tests/test_verifier_error_redaction.py,tests/test_harbor_scaffold_transactions.py,tests/test_benchmark_source_provenance.py,tests/tier3/test_skip_with_skill.py,tests/reporting/test_rich_markup_escaping.py,tests/reporting/test_unified_tier3_report.py,tests/test_ci_workflows.py, and the docs and CHANGELOG readers (test_oss_packaging.py,test_ci_change_classifier.py,test_accuracy_arithmetic.py,test_benchmark_rollout_docs.py,test_tier3_public_runtime.py,tests/ci/test_image_build.py), plustests/cli/test_tier_workflows.py: 1988 passed with-n 8.ruff checkis clean on the changed Python files, andscripts/check_oss_boundary.pypassed.ruff format --checkis clean on them excepttests/inference/test_llm_client.py, where it reports only two longmonkeypatch.setattrlines that are already onmain(it fails there too). Open PR fix(inference): recover one JSON object wrapped in LLM prose #297 wraps those lines, so this PR leaves them alone. CI runsruff checkonly.🤖 Generated with Claude Code