Skip to content

fix: sweep round 7: compile before a draft send, test turns and checks, nothing_to_update, honest --dry-run, home prompt Next lines - #61

Open
Bradenream wants to merge 26 commits into
braden/sweep-r6from
braden/sweep-r7
Open

Bradenream wants to merge 26 commits into
braden/sweep-r6from
braden/sweep-r7

Conversation

@Bradenream

Copy link
Copy Markdown
Contributor

Stacked on #60. Fixes the CLI-owned majors from round 6 of the usability sweep, plus the minors several testers hit. Each fix is its own commit, with a test that replays the tester's scenario and fails without the fix. Each commit message says what testers saw, the cause, and the change. The numbers below are round-6 issue numbers.

This round worked cause-first. In round 6, a fix counted as done when it did what its commit said, and testers still hit the problem. So each fixer reproduced the report offline and found the cause in the code before changing anything, and the fix-verifier replayed each original tester's scenario, not the commit's own repro.

Conversation

  • feat: add E2E tests (COR-13123) #1 Every conversation send on the draft compiles it first, mid-conversation too. Before, vf compiled only before a turn that started a conversation, so the turn after an edit ran the old build.
    • A live check on the real API found why: a conversation isn't pinned to a build. Its state's compiledSourceHash moves to the newest compile on the next turn. Only the turn between an edit and a compile was stale, and nothing cheap says when one is needed.
    • A compile costs 0.2–0.3 s on the server for a small agent, and 0.5–0.8 s for one shaped like our largest. The sweep measured a draft send at 1.55 s median, against 1.32 s for a published send.
    • One spinner line: "Compiling the draft…", then "Waiting for the agent…". The "✓ Compiled" line is gone; a compile over 2 s leaves a muted "Compiled the draft in 2.3s".
    • A draft that won't compile sends nothing: compile_failed, exit 1.
    • The new --user-id / state delete advice from fix: sweep round 6: every suggested command runs, @file for code and secrets, function check exit 6, environment export, add-playbook #60 is gone from the warning, help and README.
  • feat: errors that teach — every failure names its own fix (COR-13588) #9 Ctrl-C during a send says whether the message went out. vf notes when the request's headers were written: before that, "Canceled. Nothing was sent."; after, "the message may have reached it", with a state get command that shows the last exchange.
  • fix: never abort the wrapper publish on a lagging registry read (COR-13649) #15 conversation state get/update/update-variables/delete default --version-param to draft, as send does.

Tests and evaluations

Scripting

Home prompt, forms and knowledge

Tools, tables and output

For the API team (not in this PR)

  • Updates return only {"message": …}, so variable update --jq .variable.id prints null. Return the updated resource.
  • project update can't set a description.
  • function check's "0 failed" counts only cases that threw.
  • The spec doesn't say an evaluation needs an ended transcript, and marks variableStates and enabled required though [] and false are safe defaults.
  • Nothing says whether a draft needs a compile; vf compiles before every draft turn instead.

Testing

What testers saw: after `agent update --instructions "… Always end every
reply with the exact sentence: Have a great coffee day!"`, a send to maria,
mid-conversation, answered without the rule, then warned "⚠ This turn ran
an older build of the draft. vf has compiled the draft now. To be sure a
conversation runs your latest edits, start a new one: a new --user-id, or
reset this user's with 'vf conversation state delete …'" (round-6
human-newcomer:F3, R6 #1; agent-builder:F7 and fix-verifier noted the same).

Cause: autocompile.go compiled the draft only before a turn that starts a
conversation, deciding that from a state GET (startsConversation: an empty
stack). maria's stack wasn't empty, so the send went out with no compile and
ran the build from before the edit. A live check on the real API showed a
conversation isn't pinned to a build (the base frame's
storage.compiledSourceHash changes on the next turn after a compile), so the
only stale turn is the one between an edit and a compile, and nothing cheap
says when one is needed. A compile costs 0.2-0.3 s on the server for a tiny
agent and 0.5-0.8 s for a large one, changed or not; a turn costs 0.9-2.1 s.

Change: send compiles the draft before every turn, launch or not, as
run-script did, and reads no state first. One spinner line says "Compiling
the draft…", then "Waiting for the agent…" (ui.Spinner.Say,
client.StartSpinnerLine); the "✓ Compiled the draft of main (0.5s), so this
runs your latest edits" line is gone, and a compile over 2 s leaves one
muted "Compiled the draft in 2.3s", in the pretty view only. A draft that
won't compile stops before anything is sent: the compile's error,
error_type compile_failed, exit 1 (not 2, since the flags were fine and
other flags won't help; a 401 or 404 keeps its own type and exit 3 or 4,
since the fix is the credential or the IDs). The needsRecompile check after
the turn stays, for an edit that lands during it: "This turn ran the build
from before an edit made during it. vf compiled it, so your next turn runs
it." If that compile fails, it warns rather than failing a turn that ran.
The new --user-id and state delete advice is gone from the warning, send's
help and the README. Agent-mode and JSON output are unchanged on success.
--no-compile and the published version still skip the compile.

test run create and create-suite take no version, and nothing in the API
says which build they run, so offline vf can't tell whether they need a
compile; they are unchanged. Evaluations score saved transcripts and run no
turn.

Tests: TestTheTurnAfterAnEditRunsIt replays F3 against a fake runtime that
runs the draft as last compiled (fails at the base: the reply lacks the rule
and the stale warning prints). TestAConversationWithTheDraftCompilesItFirst,
TestATurnReadsNoStateFirst, TestAStaleTurnSaysVfCompiledIt,
TestACompileAfterTheTurnThatFailsOnlyWarns,
TestADraftThatWontCompileSendsNothing,
TestCompilingAddsNothingToAgentOrJSONOutput,
TestATurnSaysEachPhaseOnOneSpinnerLine, TestATurnWithNoCompileOnlyWaits,
TestASlowCompileSaysHowLongItTook, TestSpinnerSaysEachStepOnOneLine.
… out

What testers saw: in the home prompt, `conversation send -p … -u pu-2 -e
main --text 'Do you ship to Canada?'`, then Ctrl-C after 1.5 s, printed
"✓ Compiled the draft of main (0.3s)…" and "✗ Canceled". `transcript get`
then showed the whole exchange: the message, and the agent's reply
(round-6 human-poweruser:F1, R6 #9). Someone who reads "Canceled" sends it
again, and the agent gets it twice.

Cause: Ctrl-C in the home prompt cancels the line's context (cli/home.go),
which aborts the request vf is waiting on, and output/canceled.go explains
any canceled request as "Canceled". But the turn's PUT is a few hundred
bytes, written in full within milliseconds of the compile ending, and the
runtime finishes a turn whether or not the client still waits; a turn
takes 0.9-2.1 s. A Ctrl-C at 1.5 s lands after the request went out:
canceling stopped vf waiting, not the turn. (In a shell Ctrl-C ends vf
itself, with nothing printed, so there was no claim to correct there.)

Change: the turn's request carries an httptrace hook that notes when its
headers are written; the message, in the body, can't go out before then.
A cancel before that, during the compile or while connecting, says
"Canceled. Nothing was sent." (it used to read "Couldn't compile the draft"
during a compile). One after says "Stopped waiting for the agent, but the
message may have reached it", that sending it again could send it twice,
and gives `vf conversation state get --user-id … --project-id …
--environment-alias … --version-param … --jq ".state.variables |
{last_utterance, last_response}"`, which shows the last message the agent
got from that user and its reply (the runtime keeps both in the user's
state). IDs are double-quoted when they need it, since plain and JSON
output put commands in single quotes. run-script says the same, with the
state command when --user-id named the user, or `transcript search` for
the environment when the API picked one. While the turn is out the
spinner's hint reads "ctrl-c stops waiting, not the turn", not "ctrl-c to
cancel". Both outcomes keep error_type canceled and exit 1, as every other
cancel does.

Tests: TestCtrlCAfterTheMessageWentOutSaysItMayHaveReachedTheAgent replays
F1 through the home prompt's runLine (fails at the parent: "Canceled" while
the API got the message); TestCtrlCBeforeTheMessageWentOutSaysNothingWasSent,
TestCtrlCAfterAScriptWentOut, TestTheCommandACanceledTurnGivesRuns (the
command passes cmdcheck for IDs with spaces, quotes and $).
What testers saw: right after a conversation, `vf conversation state get
-u sweep-ab-user2` failed with "vf conversation state get needs
--version-param" and exit 2, while send, run-script and knowledge-base
query default to draft (round-6 agent-builder:F6, agent-migrator:F9,
fix-verifier:N8, R6 #15). `state delete` failed the same way for people who
had stopped passing -v to send.

Cause: the generated metas of state get, update, update-variables and
delete mark --version-param Required with no default
(conversation/state/get.go:22 and the like); c9a0e38 defaulted only send's
and knowledge-base query's.

Change: conversation/state/version.go makes --version-param default to
draft in all four, with one hook line in each generated file, and its help
says what each version is: draft, the conversations with your latest
edits, which send has by default; or published, your live users'. Passing
-v published works as before.

Tests: TestStateCommandsUseTheDraftByDefault (fails at the parent with
"needs --version-param"), TestStateHelpSaysWhatEachVersionIs.
What testers saw:
  human-poweruser:F2 took four tries to add one user turn:
    ✗ vf test turn create has no flag --test-id
    ✗ Couldn't create turn: the body has no value for
      user.payload.variableStates
      ⎿ The request wasn't sent.
        The SDK said: could not marshal union type
        StableTestTurnCreateRequestVariableStates1: all fields are null.
    ✗ vf evaluation create needs --body-param.boolean.enabled
  and "--body-param.agent.payload ... and --body-param.boolean.name have
  no description". agent-ci (dead end 3): "test turn create rejected a
  user turn without "variableStates": [] (exit 2)".

Cause:
- test/turn/create.go:18-29 and test/check/create.go register only
  --project-id, --environment-alias and the --body-param union, so a
  turn or a check can only be written as nested JSON.
- StableTestTurnCreateRequestPayload1.VariableStates is a non-pointer
  union; left out of the JSON both members are nil and MarshalJSON fails
  (sdk/models/components/stabletestturncreaterequest.go:415).
  output/badbody.go:61 then echoed the SDK's words and type name.
- evaluation/create.go:26,36,42 mark body-param.*.enabled Required, so a
  false the user never meant to choose had to be typed.
- flagutil/metadata.go:1243 returned a form's first missing field only,
  so each retry found one more.

Change:
- test turn create takes -t/--test-id with --user '<message>' or
  --agent (and --sequential); they stand in for --body-param, and
  --test-id also fills a form's JSON that leaves testID out.
  variableStates is [] unless given. Clashing flags are refused with
  what to drop. Next after a user turn adds the agent turn; after an
  agent turn, its check. test create's Next adds the first turn.
- test check create takes -t/--turn-id with --llm-eval '<criteria>' or
  --equals '<text>'; routing and tool checks stay JSON, with examples.
- evaluation create: enabled is off unless given; help says what each
  form is, with a runnable example of each.
- A form's missing fields are named together; a form flag's bad value
  shows the whole shape; badbody names the field that needs a value,
  not the SDK type.
- Help describes the payload flags. --body-param keeps working.
- The suggestion harness gives one stand-in per flag; cmdcheck refuses
  two stand-ins for the same flag; a typo is no longer "fixed" to a
  true/false flag that would take its value.

Tests: TestTurnCreateTakesTheTurnInPlainFlags,
TestTurnCreateNamesTheFlagsItNeeds, TestTurnFlagsThatClashAreRefused,
TestCheckCreateTakesTheCheckInPlainFlags,
TestEvaluationCreateIsOffUnlessEnabled,
TestEvaluationCreateNamesEveryMissingField,
TestTestWriteFlagsSayWhatTheyAre, TestTurnCreateNextIsTheFollowingStep.
…ds it

What testers saw:
  agent-ci:F2, after `conversation send … --text "What are your store
  hours?"` then `evaluation run -p $P -e $EID -t $TRID --jq .result`
  (exit 1):
    "error_type": "validation_error",
    "message": "Transcript with id '6b0e3610aa49f8b7c0a24c38' has not
      ended yet and cannot be targeted for evaluation.",
    "hints": [
      "Add '--dry-run' to see the exact request without sending it",
      "'vf evaluation run --help' lists the flags and the values they take"
    ]
  "`evaluation run --help` doesn't mention the requirement … The end
  action is only discoverable from an example on `conversation send
  --help`. Run A died here." human-poweruser:F11 saw the same Next lines.

Cause:
- The rule is the API's: a transcript can be evaluated once its endedAt
  is set, which the end action does (agent-ci run B succeeded after
  `conversation send … --action end`).
- evaluation/run.go:77 passed the 400 to output.Error, whose generic
  400 explanation (output/explain.go explainAPI) is validation_error
  with the --dry-run and --help hints. Its help said only "Run an
  evaluation."

Change:
- That 400 now has error_type transcript_not_ended and one step: the
  end action for the transcript's own conversation, `vf conversation
  send --project-id P --environment-alias <its environment> --user-id
  <its sessionID> [--version-param published] --action
  '{"type":"end"}'`. vf reads those from `transcript get`; when it
  can't, the step says `vf transcript get …` shows them.
- evaluation run's help says the transcript's conversation must have
  ended and how to end it; --transcript-id says so too.
- Any other failure is explained as before.

Tests: TestEvaluationRunOnAnOpenTranscriptSaysHowToEndIt (both modes,
draft and published; each step passes cmdcheck),
TestEvaluationRunOnAnOpenTranscriptItCantLookUp,
TestEvaluationRunOtherFailuresAreUnchanged,
TestEvaluationRunHelpSaysTheTranscriptMustHaveEnded.
…failed

What testers saw:
  agent-ci:F6, `vf test run create-suite -p $P -e main --test-ids $TID
  --wait --max-wait 6m --jq .` with a check built to fail (exit 6;
  stdout had "runID": "6b0e36a2297e8fc83d574ebe"):
    "error": "1 of 1 runs in suite 6b0e36a2ad64d70007a23380 did not pass (1 failed, 0 canceled)",
    "error_type": "error",
    "explanation": "Read a run's logs: vf test run get --project-id … --environment-alias main --run-id <id>",
    "hints": []
  "CI logs usually show stderr. The run ID is known but not printed
  there." human-poweruser:F12: "Next says `vf test run get … --run-id
  <id>`, although the one failed run's ID is known."

Cause:
- test/run/createsuite_wait.go:485 wrote `--run-id <id>` though the
  wait's answer lists the runs that didn't pass, failed ones first.
- suiteError (createsuite_wait.go:553) gave the envelope only in agent
  mode. With --jq or -o json outside it, the error was a plain one, so
  the root wrapped it as error_type "error" with the hints run into its
  explanation. test run wait's errors (wait_exit.go) did the same.

Change:
- Each run that didn't pass gets a step with its ID, up to three; more
  are counted, and their IDs are in the output's runs.
- suiteError gives the envelope whenever the error is wanted as JSON
  (agent mode, -o json, --jq), so error_type is test_suite_failed (and
  test_runs_failed, test_suite_unfinished, … for the other failures),
  with the steps as hints. Exit codes are unchanged.

Tests: TestFailedSuiteNamesItsRunsAndItsErrorType (create-suite and
wait-suite, --jq and agent mode, and the terminal),
TestFailedSuiteListsEachRunThatDidNotPass (each step passes cmdcheck);
TestTestRunWaitExitsNonZeroUnlessEveryRunPassed reads the envelope;
test/run-suite-wait.test.ts expects --run-id r1, not <id>.
What testers saw: human-newcomer:F1 and fix-verifier:N10. In the home
prompt, `agent update` asked "Fill in 16 optional field(s)? Prompt, End
Tool, Card Tool, Playbooks, …" with No chosen; Enter sent an empty update
and got "HTTP 400 … At least one field must be provided." Yes walked the
fields a screen each, six JSON ones before Instructions. Instructions read
"--instructions (JSON)" though it takes text, Prompt said only "--prompt",
nothing said Enter skips a field, and document create-text's --overwrite
read "(JSON)" too.

Cause: PromptAndSetFlags (interactive.go) offered every command's optional
fields behind one Yes/No defaulting to No, so on an update whose only
required flags the current project and environment fill, No could only
send an empty body. It asked them in the generated metadata's order. Each
field's words came from that metadata ("string value", which describe()
drops), while help's words for --prompt and --instructions are written
later, on the flag (cli/barehelp.go). And buildFormField added " (JSON)"
to every FlagKindJSON and FlagKindUnion field: --instructions is typed
JSON only because its field is OptionalNullable[string], --overwrite only
because it is a union of a boolean and its text.

Change: interactive/optionalfields.go, behind one-line hooks.
- An update with nothing to change on its line goes straight to its
  fields (no question whose default sends nothing). Text fields come
  first, then plain values, then JSON. Once one is filled in, the rest
  are offered with one question, No chosen, and No sends what was given.
  Anything else (a create, or an update given a field) asks first, as
  before.
- A field shows help's words for its flag. A text flag says "Plain text,
  or @file to read it from a file" (flagutil.TakesText: it reads @file,
  or it is a JSON flag whose field holds a string). A true-or-false union
  is a Yes / No / Skip choice. "(JSON)" is added only to a JSON flag whose
  words don't say JSON. An optional input says "· enter skips".
- A list field says how to give several values in a form, in place of
  "(comma-separated)", which was wrong for lists of free text.
Going straight to the fields was chosen over defaulting to Yes: with Yes
chosen, the question still has an answer that sends an empty update, and
it costs a screen before the field people came for. If every field is
left empty the update is still empty; the generic empty-update refusal
is another fix's.

Tests: TestAnAgentUpdateGivenNothingStartsOnItsFields replays the
newcomer's `agent update` in the home prompt against a fake API, with
the form answered through a seam (export_test.go). Before the change it
saw "Fill in 16 optional field(s)?" first.
What testers saw: human-newcomer:F2. In a second home prompt with no
current project, `document create-url -p 6b0e33e3e464c9bb0d1e0a16 --url
…` ended with "Next: vf document get --document-id 6b0e… --wait" and
"vf document list -o table". Run as written, the list opened a
workspace picker and ended "✗ Canceled". The prompt's border then read
"environment Main" with no project.

Cause: every Next-line builder left the scope out whenever a home prompt
was open: `if session.Active()` in withScope (output/hintfit.go), in
docRef.get and announceAdded (document/docready.go), in the playbook
route hint and the widget's publish hint. They assumed the context held
the line's project, but it holds only what was picked or used; a -p typed
on a line is for that line. And pickers.go made the environment picked
for the typed -p current (session.Set after every pick), with no project
current, which is the border's "environment Main". The same check let a
current environment be taken for another project typed with -p.

Change: session.Unheld and session.Scope say which scope flags a line
must carry: the ones the context doesn't hold with that value, and, once
a level isn't held, the narrower ones (the current environment is the
current project's). Outside a home prompt that is every flag, as before.
withScope, docready, routehint and snippetcheck use them; stillNeeded
runs in the home prompt too, skipping what the context fills in. The
widget's publish line keeps -e, since publish asks which environment
even with one current. A pick becomes current, and a current one is
used, only when what it is listed from is current: an environment picked
for a typed -p stays on the line.
Keeping -p on the line was chosen over making a typed -p current: a flag
on one line is a one-off, as gh's -R or kubectl's -n is, and making it
current would silently retarget the lines that follow.

Tests: TestInTheHomePromptNextKeepsATypedProject (document),
TestInThePromptANextLineKeepsAProjectTheContextDoesNotHold (output),
TestAPickUnderATypedProjectIsNotMadeCurrent (interactive),
TestScopeIsWhatTheContextDoesNotHold (session). Without the change the
first prints the tester's bare `vf document list -o table`, and the
third's context becomes "environment Main".
…ishes it

What testers saw: human-kb:F1. "✓ Added billing.md (6b0e…) · ready: the
knowledge base answers from it (2s)", the same from create-table,
create-url and `document get --wait`. Then `knowledge-base query
--version-param published` said "No sources: nothing in the knowledge
base matched." with five documents added. After `environment publish
--name 'KB v1'` the same published query returned refunds.md 0.5844; the
only release before was "First version", from project creation.

Cause: docready.go's announceAdded and waited.outcome wrote "ready: the
knowledge base answers from it" for status SUCCESS, which is the draft's
status: the published version's knowledge base gets documents only with
a publish, and nothing said so. answer.go wrote the same "No sources:
nothing in the knowledge base matched." for either version.

Change: what the report shows, and no more. A ready document reads
"· ready in the draft" (or "is ready in the draft (2s)" after a wait), and
Next is the publish that puts it in the published version, named for
what was done: `vf environment publish -p … -e main --name "Add
billing.md"`, "your live agent's knowledge base has it after this". A
published query that finds nothing says "nothing in the published
knowledge base matched. Documents added since the last publish may not
be in it yet.", with Next the same question of the draft and the
publish; TOON carries it as noSources. Each line runs as written, in the
home prompt too (session.Scope; publish always keeps -e, since it asks
which environment otherwise). A draft query's words are unchanged.

Tests: TestAReadyDocumentIsReadyInTheDraft (document),
TestAPublishedQueryWithNoSourcesSaysDocumentsMayNotBePublished (cli).
Without the change they see "ready: the knowledge base answers from it"
and the unqualified "No sources" line.
…older

What testers saw: human-kb:F2, fix-verifier:N1. "The default `document
list` at a terminal shows `FOLDER ID` hex, drops it at 80 and 100
columns, and drops STATUS at 72. Only `-o table` names folders."

Cause: since 43d5be2 the default output of `document list` at a terminal
is its table (output/listtable.go), but foldernames.go's withFolderNames
named folders only when output.FormatOf(cmd) == "table". The default
format is "pretty", so the default table got the API's answer, with its
24-character folderID, and the width rules cut that wide column, or
STATUS beside it, first.

Change: withFolderNames names folders whenever the list prints as a
table: -o table, or pretty output for a person at a terminal (the
condition writeListTable uses). Off a terminal pretty output, JSON, YAML,
TOON and agent mode get the API's answer as before, and read no folders.
Each row keeps its status. With folder names, three documents at 72
columns show ID, NAME, TYPE, STATUS and FOLDER; with the hex IDs FOLDER ID
was left out at 72. A long NAME (a URL) still pushes STATUS out at 72 and
80 and FOLDER at 100; which columns go first is the width rules' call,
not this file's.

Tests: TestTheDefaultTableAtATerminalNamesEachFolder. Without the change
the default at a terminal returns the API's answer (no folder names).
What testers saw: human-kb:F8, human-newcomer:F5. In the `/` menu, "know"
then Enter gave "❯ knowledge-base  Query the knowledge base" and then
"❯ query  Execute a query against documents in the knowledge base",
nothing else: "I found `document` only by typing 'upload'". And `vf
knowledge-base add` said only:
  ✗ vf knowledge-base has no command "add"
    Next:
      vf knowledge-base --help lists its commands

Cause: the menu's intents (prompt/intents.go) mapped "upload", "add",
"kb" and "faq" to document create-text, create-url and create-table, but
not "knowledge", and a group's submenu (complete.go subcommands) lists
only its own children: knowledge-base has one, query. errors.go's
unknown_command offered cobra's SuggestionsFor, which looks only at the
group's own children, then the group's --help.

Change: knowledge-base names the commands that add to it, in a new
annotation (usage.AddedWith, set in knowledgebase/documents.go). The
menu lists them under knowledge-base after query, and by name or intent
("knowledge-base add", "knowledge-base cr"); picking one replaces the
line. "knowledge" joins the intents, so "/know" lists knowledge-base and
then the three. An unknown command in a group with AddedWith adds a Next
line that runs as written: "Adding to it is under vf document: `vf
document --help` lists create-text, create-url and create-table"
(cli/addedwith.go, one hook line in errors.go). Other unknown-command
guesses (`web chat`, `transcript list`) are R6 #18, not changed here.

Tests: TestKnowledgeBaseLeadsToAddingDocuments (prompt),
TestKnowledgeBaseAddPointsAtTheDocumentCommands (cli). Without the
change "/know" lists knowledge-base alone, "knowledge-base " lists query
alone, and the error has no pointer.
What testers saw: fix-verifier:N3 (R6 #50): `environment diff` ended
"'vf environment publish' ships it", which run as written stopped at
"needs --environment-alias, --project-id and --name"; `knowledge-base
--help`'s `vf document create-text --file faq.md` stopped at "needs
--project-id and --environment-alias". R6 #64 (fix-verifier:N13,
human-kb:F13, human-poweruser:F16): widget "the draft has 7 changes since
that it doesn't."; every Next suggests the same `--name "Website
widget"`; `function create --code @missing.js` explained "there is no
file lookup_order.js to read for --code; …" in lowercase; create, get
and update say "ready" while `document list` says SUCCESS; "Waiting up
to 30m0s".

Cause: diffcoverage.go's footer and knowledgebase/documents.go's help
lines were prose written without the flags their commands require.
snippetcheck.go's warning read "since that it doesn't" and named every
release with the const releaseName. errors.go put the flag parser's
cause in Why as it came, lowercase. docready.go wrote "ready" with no
status, and printed durations with time.Duration's String ("5m0s").

Change:
- diff's footer gives `vf environment publish -p … -e … --name <name>`;
  kb help's four lines add `-p <id> -e <alias>`. Every publish line vf
  suggests now comes from session.PublishScope: -p unless the home
  prompt holds it, and always -e, since publish asks which environment
  otherwise (docready, answer.go and snippetcheck had a copy each).
- widget: "The draft has 7 changes since then, which the widget won't
  show until you publish.", and `--name <name>`: the release is yours to
  name, not always "Website widget".
- An invalid flag value's cause starts with a capital: "There is no
  file …", "Invalid syntax.".
- A ready document says "ready in the draft (SUCCESS)", the status
  `document list` shows; durations read "5m", "1m30s", "2s".
  `test run create-suite`'s "Waiting up to 30m0s" is in
  test/run/createsuite_wait.go, the tests fixer's; not changed here.

Tests: TestEnvironmentDiffSaysThePromptIsNotCompared and
TestKnowledgeBaseHelpSaysHowToAddDocuments (each help line through
cmdcheck), TestWidgetSnippetWarnsWhenTheWidgetServesAnOldVersion,
TestABadValuesExplanationIsASentence, TestAReadyDocumentIsReadyInTheDraft,
TestDurationsReadAsAPersonWritesThem, TestScopeIsWhatTheContextDoesNotHold.
Each fails without the change.
…" is sent as ""

What testers saw:
- agent-builder:F2: `vf variable update -v … --default-value ""` exited
  1 with "Couldn't update variable · HTTP 400 Bad Request … At least one
  field must be provided.", and `--dry-run` showed `Body: {}`.
- agent-builder:F9: `vf project update -p … --body
  '{"description":"Bike shop support agent"}'` warned that description
  isn't taken, then sent `{}` and got the same 400. "`--dry-run` shows
  `Body: {}` and exits 0."
- human-poweruser:F11: `event update … --event-id … --no-interactive`
  with no field: "✗ Couldn't update event · HTTP 400 … At least one
  field must be provided. Next: Fix the values above".

Cause:
- The dropped "": buildJSONField (internal/flagutil/metadata.go) returns
  early on `val == ""`, whether or not the flag was typed. --default-value
  is a FlagKindJSON flag for an OptionalNullable[string], so the "" typed
  never reached the body. A string flag for the same kind of field already
  sends "" (stringflag.go), so the two kinds disagreed.
- The stripped key: StableProjectUpdateRequest takes only `name`
  (`additionalProperties: false` in the spec), so description is rightly
  dropped and warned about. A --body key the schema knows is kept:
  `variable update --body '{"defaultValue":""}' --description d` sends
  both.
- All three then sent `{}`: nothing checked for a PATCH with no field, so
  the API's 400 was the first word, and --dry-run predicted success.

Change:
- A JSON flag typed as "" for a field that holds plain text sends "", as
  a string flag does. Untyped flags still leave their field out, and ''
  for an object, number or enum is still read as not given.
- A PATCH whose JSON body is `{}` is refused before it is sent, dry run
  included (internal/client/emptyupdate.go): exit 2, error_type
  nothing_to_update, naming the flags that set a field of that command's
  body (flagutil/bodyflags.go, recorded from the metadata) and --body.
  This also covers the agent update form left blank.

    ✗ Couldn't update event · nothing to change
      ⎿ No flag set a field.
        The API refuses an update with no fields, so nothing was sent.
      Next:
        Give one or more of --description, --name, --request-name,
        --goes-to or --workflow-id, or the fields as JSON with --body
        `vf event update --help` says what each one takes

- The stdin test that ran `agent update --dry-run` with no body now
  expects that refusal.

Project description can't be set by any vf flag or --body: the API's
update schema has no such field (API side).

Tests: TestAnUpdateThatSetsNoFieldIsNotSent,
TestAnUpdateThatSetsNoFieldTellsAnAgent, TestAnEmptyTextFlagIsSent
(internal/cli), TestOnlyAnEmptyPatchIsRefused (internal/client). Each
fails with the fix reverted.
What testers saw:
- agent-ci:F3: "`--dry-run` on a read prints a made-up empty response to
  stdout, and `--jq` runs on it":

    variable list --dry-run --jq '.variables | length'   stdout: 0
    project get   --dry-run --jq .project.id             stdout: null
    project get   --dry-run -o json                      stdout: {}
    variable create --dry-run --jq .variable.id          stdout: (empty)

  "a dry-run pass of a pipeline reads '0 variables' or the ID 'null' as
  real answers, and writes behave differently."
- R5 #44 (agent-ci:F6): "The plan is text on stderr only, even with
  `-o json`."

Cause:
--dry-run swaps in DryRunClient (client/diagnostics.go), which answers
every request with a stand-in: 200 and `{}`. A read's 200 is its success
code, so output.Result formatted `{}` like any answer: `-o json` printed
it, and --jq ran on it (`.variables | length` → 0, `.project.id` → null).
A create succeeds only with 201, so its stand-in came back as an SDK
error, which output.Error drops for a dry run (output/dryrun.go) and so
printed nothing. Reads and writes differed by their success code, not by
anything the user chose.

Change:
- Result no longer prints a dry run's stand-in, and --jq never runs on
  it.
- With -o json or --jq, stdout gets the request that would have been
  sent, for reads and writes alike and in either mode:

    {
      "dry_run": true,
      "method": "POST",
      "url": "https://…/v2/stable/variable?environmentAlias=main&projectID=p1",
      "body": { "color": "#515A63", "name": "x" }
    }

  The body is redacted as the stderr preview is (a secret reads
  [REDACTED]), without its 4 KB cut; a non-JSON body is given by type and
  size. With --jq, stderr says the filter had no response to run on.
- Otherwise stdout stays empty. The stderr preview is unchanged.

Tests: TestADryRunPrintsTheRequestNotAMadeUpAnswer (fails with the fix
reverted), TestADryRunWithoutJSONPrintsNothingOnStdout,
TestADryRunsRequestOnStdoutHidesSecrets.
…sage prints its schema

What testers saw:
`vf --usage` had no auth, docs, explore or completion, no `environment
export`, and no `agent add-playbook` or `remove-playbook`, though `vf
--help` lists each (R6 #11). An agent that loads the schema to learn vf
in one read never saw them. Their own --usage was worse: `environment
export --usage` failed with "usage schema not found for command path",
`docs search --usage` wanted a query, `auth --usage` printed help,
`completion bash --usage` printed the bash script, and `auth login
--usage` opened the browser to sign in. And `conversation send` and
`knowledge-base query` default --version-param to draft, but --usage
gave the flag no default, as the spec has it.

Cause:
internal/usage/schema.go is generated by Speakeasy from the API spec: a
fixed map of KDL text by command path (usageSchemas), and EmitSchema
looked the path up there. Commands vf adds by hand aren't in the spec,
so they were in neither the root schema nor the map. Each generated
command checks --usage first thing in its RunE; the hand-written ones
don't, so --usage ran them. ownhelp.go already took each flag's help and
shorthand from the live tree, but kept the spec's default.

Change:
- usage/livetree.go writes a command's schema from the command tree
  (summary, aliases, arguments, visible flags, listed subcommands).
  EmitSchema uses it for a path the map lacks (one-line hook in
  schema.go), and ownhelp.go adds to each block the listed subcommands
  the schema lacks, and leaves out the ones the tree hides.
- cli/usageanywhere.go makes --usage answer on any command: it relaxes
  argument checks under --usage, turns the command's run into printing
  the schema (completion's too), and has a group that doesn't run print
  its schema instead of help.
- A flag line's default= now follows the live flag: --version-param says
  default="draft" where vf defaults it, --synthesis #true, and --max-wait
  its duration. A flag is called required only by its help, which is the
  live flag's.

Tests: TestUsageListsEveryCommandHelpDoes (every command and visible flag
`vf --help`'s tree has is in `vf --usage`), TestEveryCommandsOwnUsage-
PrintsItsSchema (each listed command's --usage prints its schema and
sends nothing), TestUsageGivesAFlagTheDefaultVfGaveIt, and
TestUsageDescribesEachFlagAsHelpDoes now also checks each default, and
that no flag with a default is called required.
What testers saw:
`vf conversation send … --text Hello there` in agent mode hinted
"To send it as a message: 'vf conversation send … --text 'Hello there''"
(R6 #51): the message's single quotes nested in the ones the JSON puts
around the whole command, so it read as two quoted commands with the
words Hello there bare between them.

Cause:
asMessage (cli/strayargs.go, from 0d89c85) quoted the message with
shellQuote, in single quotes. A hint names its command in backticks, and
output.Plain turns them into single quotes for JSON and any output that
isn't a terminal. The missing-flag hint quotes its values with shellWord,
in double quotes, and didn't nest.

Change:
The message is quoted as the missing-flag hint quotes a value, as it is
or in double quotes (quotedWord, split out of shellWord without its
60-character cap, since the message is the point of the hint): 'vf
conversation send … --text "Hello there"'. A message with a backtick or
a newline, which would end the hint's command, is <as before>.

Tests: TestWordsAfterTextAreTheRestOfTheMessage checks the JSON form of
the hint has exactly the two quotes around its command, and it and
TestAStrayArgumentIsNamedAndNothingIsSent expect the double-quoted
message.
…once that it didn't run

What testers saw:
`vf function check` printed "summary: 2 of 2 cases ran; 0 failed; 1 of 2
matched what you expected." above "✗ 1 of 2 cases didn't pass" (R6 #71,
agent-builder:F16, fix-verifier:N7). And a check that refused to run said
so three times: "Not checked: none of the 2 cases ran. Nothing was run.
Unknown inputs: order_number. The function declares no inputs. No case
ran, so nothing was checked.", under "The check didn't run", with
"hints": [], below the same reason printed as the answer.

Cause:
The summary is the API's text, and its "failed" counts only the cases
that threw; a case that ran and didn't match isn't in it. For a refusal,
checkOutcome (cli/function/checkexit.go, from 17a6d7b) put the API's
whole reason in the why and added its own "No case ran" sentence, and
check.go printed the answer, {checked: false, reason}, before the error.

Change:
- The summary's "N failed" prints as "N threw". -o json and --jq still
  print the answer as sent.
- A refusal's error says once that the check didn't run, in its title.
  The why keeps the rest of the API's reason ("Unknown inputs:
  order_number. The function declares no inputs."), and each unknown
  input gets the command that declares it, as the check was typed: `vf
  function variable create --project-id p1 --environment-alias main
  --function-id f1 --type input --name order_number`.
- The refusal's answer isn't printed above its error, which holds all of
  it (a one-line hook in check.go). -o json and --jq still print it.

Tests: TestAFunctionCheckCountsWhatThrewAsThrew,
TestAFunctionCheckThatDidntRunSaysSoOnce (each in three modes, and the
offered command passes cmdcheck.Check with every required flag).
…and that creates it

What testers saw:
`vf agent update … --instructions @instructions.md --strict` said the
same thing three times (R6 #81, fix-verifier:N6): the answer's message,
"Kept as literal text — instructions: {customer_name}, instructions:
{tier}: …", its unresolvedReferences list, then "✗ 2 references didn't
bind, and were kept as text" with a line for each. And its Next wasn't a
command: "Create the variable, entity or tool it names, or fix the
spelling, then write the field again".

Cause:
output/strict.go (from 14fc4f1) printed the answer as it came, then
added its ✗ line after it, which names the same references; unbound()
had one Next, written as prose.

Change:
- With --strict, when a reference didn't bind, the answer prints without
  its unresolvedReferences and unresolvedMentions and without its
  message's "Kept as …" line, which the ✗ line says. -o json and --jq
  print the answer as sent.
- Next is the command that creates each variable a {token} names that
  has none, with the scope typed: `vf variable create --name
  customer_name --project-id p1 --environment-alias main`, then "Then run
  this command again: a {token} binds when the field is written, not
  later". A mention gets a line on fixing its spelling or attaching what
  it names.

Tests: TestStrictSaysItOnceAndOffersTheCommand (three modes; each
command offered passes cmdcheck.Check with every required flag).
What testers saw: "Waiting up to 30m0s" (round-6 R6 #64, human-poweruser:F16
and fix-verifier:N13). 928a5e1 fixed it for document waits; `test run
create-suite --wait` still printed "Started suite … Waiting up to 30m0s for
it to finish" and "were still going after 30m0s".

Cause: createsuite_wait.go formatted --max-wait with time.Duration's String
(lines 249 and 475); docready.go's readable() lived in the document package.

Change: readable() moves to internal/ui as ui.Duration; docready.go and the
suite wait both use it. The JSON's max_wait keeps Go's form, so scripts that
parse it see no change.

Tests: TestDurationReadsAsAPersonWritesIt; test/run-suite-wait.test.ts now
expects "Waiting up to 30m for it to finish" (fails at the parent).
What testers saw: agent-builder:F1 created a function tool with
`"captureResponse":{"order_status":{"variableOrEntityID":"6b0e…"}}`.
It saved with `functionOutputVariableID: ""`, exit 0, no warning, so the
tool never set its variable. `tool create --help` showed only
`captureResponse?: { <key>: {…} }`; the entry's shape was in
`tool update --help` alone.

Cause: the SDK holds the output ID as a plain string
(ToolNodeDataFunctionCaptureResponse.FunctionOutputVariableID, no
omitempty), so the key left out decodes as "" and vf itself sends
`"functionOutputVariableID": ""` (a dry run shows it). The API takes it.
The wiring check (tool/wiring.go, warnUnwired) looked at inputVariables
only. And create's function form runs past the 400-character shape limit
(flagutil/shape.go), so its biggest nested objects, inputVariables and
captureResponse, were cut to {…}; explainInputs put back inputVariables
only.

Change:
- An entry with no output ID is refused before anything is sent, on
  create and update (exit 2, invalid_body). It can never set its
  variable, the "" is vf's own and not the user's, and the request alone
  shows it, so refusing has no false positives and needs no read. When
  the function's outputs say which output was meant (one has the entry's
  name, or there is only one), the refusal gives the line that sends it;
  otherwise it names the outputs and the line that lists them. A dry run
  reads nothing, so it gives the list line.
- An ID that isn't one of the function's outputs needs the function's
  outputs, read from the API, and a failed read mustn't block a write: it
  is warned of after the write (tool_capture_not_wired), with the
  `vf tool update` that fixes it. The read is the one the input check
  already makes. A tool saved with "" before this warns on its next update.
- Create's and update's help spell out the entry; create's example sends
  one.

Tests: TestACaptureWithNoOutputIDIsRefusedBeforeItIsSent,
TestACaptureWithNoOutputIDNamesTheOutputsWhenItCantTell,
TestACaptureOfNoOutputOfTheFunctionWarns (each fix is run through
cmdcheck and then against the fake API),
TestToolHelpSpellsOutAFunctionToolsCaptures.
… columns

What testers saw: human-newcomer:F11, at 100 columns in the prompt,
`agent --help`: "read-instructions … as numbered line" / "s", and
"…or clear" / "it" at the left edge. human-kb:F10 at 80: "Global flags
such as --output-format, --jq and --dry-run work here too;" /
"                                             --help on its own lists
them."; "vf document create-text --file <path> --overwrite tr" / "ue.";
"update-managed-sitemap  Update a managed sitemap's URL patterns, refresh
rate" / "or smart chunking". human-poweruser:F16: `create-suite --help`
leaves "the" alone on a line, and home help breaks "tran" / "script".

Cause:
- The prompt's help (prompt_help.go) lists a group's commands as
  indented rows with no heading, so they sit in the description, where
  wrapHelpText leaves indented lines as written (code). Nothing wrapped
  them: at 100 columns the read-instructions row is 101 wide, and the
  terminal broke it.
- layoutColumns (helpcolumns.go) took any line with a space just before
  the column for a row. The footer has one at column 43, where
  create-text's and create-table's descriptions start, so it continued 43
  columns in; after `document folder create --help` it didn't.
- A command is never broken (312594f), so one at the end of a flag's
  description, at column 29, ran past the edge of an 80-column terminal.
- Some descriptions carry their own line breaks at about 80 columns;
  wrapped a line at a time at 72, a line's last word was left alone.

Change:
- The prompt lays out a group's commands as columns, wrapping each
  summary under the summaries.
- A line at the left edge is never a row: the footer wraps at the edge.
- A line that is just a command, too wide for its column, moves left
  until it fits, whole. One wider than the terminal stays whole, to be
  copied: an example such as `vf document create-text --project-id <id>
  --environment-alias <value> --file faq.md --wait` (91 columns) is still
  soft-wrapped by an 80-column terminal. Breaking it would paste as two
  commands in a shell, and the prompt's line splitter reads `\` + space as
  an escaped space, so a ` \` continuation doesn't work there either.
- Examples wrap like prose; each command in them stays whole.
- A description's paragraph is joined before it is wrapped (an indented
  line, a list item, a command and the line after a colon start afresh).

Tests: TestEveryCommandsHelpKeepsItsColumns now runs at 60, 72, 80 and
100, in the prompt too, and fails a command list or example line a
terminal would break mid-word; it also replays the four cases above.
Without the fix it fails on every group's list in the prompt.
What testers saw: human-poweruser:F6 at 72 columns. `secret list` with a
52-character name: "ID  NAME" and the name cut, VISIBILITY and HAS VALUE
left out. `evaluation list`: PROMPT cut to "Determines whethe…", DEFAULT
and ENABLED left out. `transcript search`: CREATOR URL cut, so it opened
nothing, beside DURATION SECONDS, with CREATED AT left out.

Cause: fitTable (tablefit.go, 2be15c1) left columns out tier by tier,
true/false columns before long text, until the rest fit at their least
width. It never put one back, and once the name had to be cut it cut it
only as far as needed for what was left, so a name too long to fit
whole took the room of every short column. A URL was cut like text, and
a transcript, which has no name, had nothing that stayed but its ID.

Change:
- True/false columns go after long text: a flag says all it has in 9
  columns, and long text cut to 16 says little.
- A URL is whole or left out.
- A column left out goes back in, the most useful first, when there is
  room once the others are out.
- When the name is cut anyway, it is cut further, to 16 columns at the
  least, to keep short columns (12 wide or less).
- A row with no name and no status is known by its createdAt, which
  stays as a name does.

At 72: secrets show ID, NAME (STRIPE_RESTRICTED_LONG…), HAS VALUE,
VISIBILITY; evaluations ID, NAME, TYPE, DEFAULT, ENABLED (the prompt is
cut at 100); transcripts ID, CREATED AT, DURATION SECONDS.

Tests: TestANarrowTableKeepsShortColumns replays the three tables at 72
and 100 and checks a URL is whole or left out at 72 to 200; it fails
without the fix. 2be15c1's tests pass unchanged, their checks now in
checkFit. TestATableFitsTheTerminalsWidth (b5380c5) wanted the events'
description cut to "Fired by the sh…" at 72 and IS SYSTEM left out; it
now wants the reverse, which is this fix, and still wants the
description cut at 100 and 160.
What testers saw: human-newcomer:F7, `vf environment publish --name
"Website widget"`: "environment: alias: main … release: backupID:
1892561 name: Website widget", "no ✓ line and no Next. I had to rerun
`widget get-snippet` to see that the warning was gone." human-newcomer:F10:
"`agent update` prints only `✓ Agent updated.`, with no echo of what
changed and no Next." human-poweruser:F12: "`secret create` prints only
the record: no `✓ Created …` line and no Next lines." agent-builder:F3:
`vf tool update … -o json` gives `{"message":"Tool … updated."}`, so
"every write needs one more call to read it back".

Cause:
- afterResult (created.go) announced only create, clone and duplicate;
  an update or a publish got no Next, and a publish no ✓ line.
- createdObject (created.go) took the answer for the thing made unless
  the answer wrapped exactly one key. A secret made with a value answers
  {"secret": {...}, "environmentAlias": "main", "versionVariant":
  "published"}, three keys and no top-level id, so it was read as a
  thing with no ID: no ✓ line, no Next. Made without a value, it had
  both.

Change, for a person reading pretty output at a terminal:
- `environment publish` starts "✓ Published release Website widget to
  environment Main (main)" and ends "Next: vf widget get-snippet
  --project-id … --environment-alias main  the web chat snippet, which
  serves it".
- An update keeps its "✓ … updated." line and ends with its group's get,
  with the ID, the scope and what else get requires as the update was
  given them: `vf tool get --tool-id … --type function --project-id …
  --environment-alias main`, --type from --body-param.function.
- A create's thing is the object under its group's name when the answer
  holds more: secret create with a value now has its ✓ line and Next.
- updated.go holds this; created.go gets the hook, and its Next printing
  is shared.
JSON, YAML, --jq, agent mode and a pipe are unchanged: the API's answer
alone. An update's answer is still only its message; returning the
updated thing is the API's to change.

Tests: TestUpdatesAPublishAndASecretEndAsACreateDoes runs output.Result
for the four commands above as at a terminal (export_test.go's
AtATerminal; isTerminal in ui.go is now a var for it) and checks the ✓
line, the Next line and that it runs as written (cmdcheck); it fails
without the fix. TestAnUpdatesAnswerIsUnchangedInJSON covers -o json,
--jq and an empty answer. TestEveryUpdatesNextLineRuns holds the Next
line of every update with a get, 27 of them, and publish's to cmdcheck.
What testers saw: the home and knowledge fixer, replaying `document
list` at a terminal after 9575cfa: a document named by its URL still
pushed STATUS out, at 100 columns too, where the name fit whole:

  ID                        NAME
  6b0e171cef80cdc9a190df12  https://help.northwind.example.com/en/articles/shipping-and-returns-policy
  (Left out to fit 100 columns: TYPE, STATUS, FOLDER ID. …)

A secret's 52-character name at 100 columns did the same to HAS VALUE.

Cause: fitTable (tablefit.go) let a short column take the name's room
only when the name had to be cut anyway. At 100 the ID and the
74-character name took exactly 100 columns, so nothing was cut and TYPE
and STATUS stayed out. And a column was short only up to 12 wide, so a
folder's name of 13 to 16 wasn't.

Change: a name over 40 wide is long text, and gives way to short columns
at any width, down to 16, as a name cut anyway does; a name of 40 or
less stays whole, as 2be15c1 wants. A column is short when it is no
wider than a column is cut to, 16. `document list` at a terminal is its
-o table (listtable.go), so it keeps TYPE and STATUS at 72, 80 and 100.

Tests: TestALongNameGivesWayToShortColumns replays the document at 72,
80 and 100, the terminal's table at 100, and the secret at 100; it fails
without the fix. The tests of 2be15c1 and 9575cfa pass unchanged.
What testers saw: fix-verifier:N12: "`--cases … expectOutputs?: { <key>:
string } }] @file reads the text from a file…`; `--playbooks …
playbookID: string }] For example: …`; `--strict … The change is saved
either way` (no period)."

Cause:
- readsFrom (flagutil/textfile.go) joined "@file reads the text from a
  file, and - from stdin." to a flag's help with a space. A help that
  ends in the JSON shape describeShape adds ends in } or ], not a
  period, so the two ran together.
- playbookroute.go appended "For example: …" to --playbooks' help, which
  ends in its shape, the same way.
- StrictHelp (output/strict.go) had no closing period, nor did a union
  flag's "…and its help shows the form's fields" (flagutil/forms.go).

Change: flagutil.AppendHelp adds text to a flag's help as a sentence of
its own, ". " after help that doesn't end one, ahead of [required];
readsFrom and playbookroute.go use it. --strict's and the union flags'
help end with a period. Help that already ended a sentence reads as
before.

Tests: TestEveryFlagsHelpEndsItsSentences walks every command's flags
and fails a JSON shape followed straight by a new sentence, and prose of
more than one sentence with no closing period; without the fix it fails
on --cases, --playbooks, every --strict and the union flags.
TestAppendHelpStartsASentence covers AppendHelp.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Generated shell commands permit unintended command substitution, while unresolved request-handling and output issues cause valid CLI inputs to fail or produce misleading guidance.

8 open issues
7 files not reviewed
  • internal/cli/conversation/runscript.go: Generated file
  • internal/cli/conversation/send.go: Generated file
  • internal/cli/conversation/state/delete.go: Generated file
  • internal/cli/conversation/state/get.go: Generated file
  • internal/cli/conversation/state/update.go: Generated file
  • internal/cli/conversation/state/updatevariables.go: Generated file
  • internal/cli/evaluation/create.go: Generated file
What changed in this PR

This PR addresses usability issues across the Voiceflow CLI’s conversation, testing, scripting, and interactive workflows. It strengthens draft-send behavior, improves actionable feedback, and adds regression coverage for reported scenarios.

Changes:

  • Compile before draft turns, clarify cancellation outcomes, and default conversation-state commands to draft.
  • Simplify test and evaluation inputs, reject empty updates, and print request plans instead of synthetic dry-run results.
  • Improve command discovery, scoped Next commands, document guidance, and terminal output.
File Description
test/​stdin-handling.test.ts Expect empty updates to fail with a usage error.
test/​run-suite-wait.test.ts Verify readable waits and concrete failed-run hints.
README.md Document compilation before every draft send.
internal/​usage/​schema.go Enable command-tree schema fallback.
internal/​usage/​livetree.go Include hand-written commands in usage schemas.
internal/​usage/​addedwith.go Define cross-group document-discovery metadata.
internal/​ui/​spinner.go Support synchronized spinner message changes.
internal/​ui/​spinner_test.go Test multi-phase spinner output.
internal/​ui/​duration.go Format durations without redundant zero units.
internal/​ui/​duration_test.go Cover readable duration formatting.
internal/​session/​session.go Preserve scope not held by prompt context.
internal/​session/​session_test.go Test context-aware scope generation.
internal/​prompt/​intents.go Connect knowledge searches to document creation.
internal/​prompt/​intents_test.go Cover knowledge-base menu suggestions.
internal/​prompt/​complete.go Include cross-group creation suggestions.
internal/​output/​updated.go Add update and publish completion hints.
internal/​output/​ui.go Allow terminal detection overrides in tests.
internal/​output/​tableview_test.go Verify short-column retention in narrow tables.
internal/​output/​strict.go Reduce repeated warnings and suggest variable creation.
internal/​output/​output.go Route dry-run responses to request-plan output.
internal/​output/​nextneeds.go Account for prompt context in suggested commands.
internal/​output/​hintfit.go Keep explicitly supplied scope in hints.
internal/​output/​hintfit_test.go Test scope preservation in prompt hints.
internal/​output/​export_test.go Expose completion-hint and terminal test helpers.
internal/​output/​explain.go Recognize empty-update errors.
internal/​output/​exitcode.go Classify empty updates as usage errors.
internal/​output/​emptyupdate.go Explain which flags can change fields.
internal/​output/​dryrun.go Print request plans and explain skipped filters.
internal/​output/​created.go Share completion output and unwrap secret responses.
internal/​output/​created_test.go Adapt response-unwrapping tests.
internal/​output/​badbody.go Replace SDK type names with field guidance.
internal/​output/​badbody_test.go Verify clearer invalid-body explanations.
internal/​interactive/​pickers.go Keep picks within their project context.
internal/​interactive/​pickers_test.go Test explicit-project picker isolation.
internal/​interactive/​interactive.go Improve optional-field forms and descriptions.
internal/​interactive/​export_test.go Add simulated form-answer helpers.
internal/​flagutil/​textfile.go Identify text fields and punctuate appended help.
internal/​flagutil/​stringflag.go Preserve explicitly empty nullable strings.
internal/​flagutil/​standin.go Preserve preferred shorthand-flag ordering.
internal/​flagutil/​missing.go Collect multiple missing union fields.
internal/​flagutil/​metadata.go Apply empty-string handling and grouped validation.
internal/​flagutil/​jsonexample.go Mark string-valued JSON flags as text.
internal/​flagutil/​inputerror.go Show full union-form shapes in errors.
internal/​flagutil/​forms.go Record body flags and refine form help.
internal/​flagutil/​bodyflags.go Identify flags that populate request bodies.
internal/​cmdcheck/​cmdcheck.go Detect conflicting shorthand flags.
internal/​client/​spinner.go Add a shared spinner for multi-step requests.
internal/​client/​emptyupdate.go Reject empty JSON PATCH requests before sending.
internal/​client/​emptyupdate_test.go Cover empty-update rejection and body preservation.
internal/​client/​dryrunplan.go Build redacted JSON request plans.
internal/​client/​diagnostics.go Attach request plans to dry-run responses.
internal/​client/​client.go Install the empty-update guard.
internal/​cli/​widgetsnippet_test.go Update publish-warning expectations.
internal/​cli/​widget/​snippetcheck.go Clarify stale publication warnings and scope.
internal/​cli/​waitexit_test.go Verify structured test-run error types.
internal/​cli/​usagetree_test.go Check usage-schema completeness and nonexecution.
internal/​cli/​usagehelp_test.go Check usage defaults against command help.
internal/​cli/​usageanywhere.go Handle usage requests across command types.
internal/​cli/​typofix.go Avoid incompatible boolean-flag corrections.
internal/​cli/​tool/​wiring.go Extend wiring checks to captured outputs.
internal/​cli/​tool/​update.go Validate captures before tool updates.
internal/​cli/​tool/​create.go Validate captures before tool creation.
internal/​cli/​test/​turn/​create.go Integrate simplified turn flags and defaults.
internal/​cli/​test/​run/​createsuite_wait.go Improve wait text and failed-run diagnostics.
internal/​cli/​test/​firstturn.go Suggest adding a newly created test’s first turn.
internal/​cli/​test/​create.go Register first-turn guidance.
internal/​cli/​test/​check/​create.go Integrate simplified check flags and forms.
internal/​cli/​suggested_test.go Account for mutually exclusive shorthand flags.
internal/​cli/​strict_test.go Verify concise warnings and runnable recovery hints.
internal/​cli/​strayargs.go Improve quoting in message-correction hints.
internal/​cli/​strayargs_test.go Cover corrected message-hint quoting.
internal/​cli/​statedefault_test.go Verify draft defaults for state commands.
internal/​cli/​root.go Install universal usage handling.
internal/​cli/​prompt_help.go Lay out prompt command lists for terminal width.
internal/​cli/​playbook/​routehint.go Preserve scope in playbook-routing hints.
internal/​cli/​outputview_test.go Cover publication guidance in formatted output.
internal/​cli/​missingflags.go Share double-quoted hint argument formatting.
internal/​cli/​knowledgebase/​documents.go Link knowledge-base discovery to scoped document commands.
internal/​cli/​knowledgebase/​answer.go Explain empty published queries and suggest next steps.
internal/​cli/​kbdocuments_test.go Validate document commands shown in help.
internal/​cli/​helpwrap.go Improve paragraph wrapping and command placement.
internal/​cli/​helpwrap_test.go Reuse command-line recognition in wrapping tests.
internal/​cli/​helppunct_test.go Check help punctuation and appended sentences.
internal/​cli/​helpcolumns.go Keep unindented footers outside flag columns.
internal/​cli/​helpcolumns_test.go Expand width and prompt-layout coverage.
internal/​cli/​functioncheck_test.go Cover clearer function-check summaries and hints.
internal/​cli/​function/​checkexit.go Distinguish thrown errors and simplify refusal output.
internal/​cli/​function/​check.go Use dedicated function-check result rendering.
internal/​cli/​evaluation/​run.go Connect unfinished-transcript diagnostics.
internal/​cli/​evaluation/​notended.go Suggest ending the transcript’s conversation.
internal/​cli/​evaluation/​evalflags.go Default evaluations to disabled and improve help.
internal/​cli/​evaluation/​create.go Apply evaluation defaults and examples.
internal/​cli/​errors.go Add document-discovery hints and sentence capitalization.
internal/​cli/​errors_test.go Cover discovery hints and clearer error wording.
internal/​cli/​environment/​diffcoverage.go Include scoped publish guidance in diff output.
internal/​cli/​dryrunstdout_test.go Cover request plans, empty output, and secret redaction.
internal/​cli/​document/​foldernames.go Name folders in default terminal tables.
internal/​cli/​document/​foldernames_test.go Verify folder names and status preservation.
internal/​cli/​document/​docready.go Clarify draft readiness and suggest scoped publishing.
internal/​cli/​document/​docready_test.go Cover readiness, duration, and scoped Next output.
internal/​cli/​docready_test.go Update readable wait-duration expectations.
internal/​cli/​conversation/​version.go Describe compilation before each draft turn.
internal/​cli/​conversation/​state/​version.go Define shared draft defaults and state help.
internal/​cli/​conversation/​state/​updatevariables.go Apply the draft default to variable updates.
internal/​cli/​conversation/​state/​update.go Apply the draft default to state updates.
internal/​cli/​conversation/​state/​get.go Apply the draft default to state reads.
internal/​cli/​conversation/​state/​delete.go Apply the draft default to state deletion.
internal/​cli/​conversation/​send.go Integrate per-turn compilation and cancellation advice.
internal/​cli/​conversation/​runscript.go Integrate shared waiting and script cancellation advice.
internal/​cli/​conversation/​canceled.go Track transmission and explain cancellation outcomes.
internal/​cli/​conversation/​autocompile_test.go Cover phased spinners and slow-compile notices.
internal/​cli/​agent/​playbookroute.go Punctuate appended playbook help.
internal/​cli/​addedwith.go Explain where cross-group creation commands live.

Review effort: Balanced

wait.stop() // autocompile.go: the spinner line goes before anything prints
if err != nil {
return output.Error(cmd, narrowActionError(req, err)) // endaction.go: only the complaints of the form the action meant
return sendFailed(cmd, wait, req, err) // canceled.go: a Ctrl-C says whether the message went out
if name == "" {
name = "document " + d.id
}
return c + " --name " + strconv.Quote(did+" "+name)
Comment on lines +99 to +101
func unpublished(cmd *cobra.Command) []ui.Tip {
if v, _ := flagutil.GetStringFlag(cmd, "version-param"); v != "published" {
return nil
alias, _ := flagutil.GetStringFlag(cmd, "environment-alias")
question, _ := flagutil.GetStringFlag(cmd, "question")
return []ui.Tip{
{Command: "vf knowledge-base query --question " + strconv.Quote(question) + session.Scope(project, alias), Does: "search the draft, which has every document added"},
Comment on lines +34 to +35
width := helpWidth(cmd.OutOrStdout())
writeWrapped(cmd.OutOrStdout(), width, func(w io.Writer) { writePromptHelp(u, w, cmd, width) }) // helpwrap.go: between words
Comment on lines 64 to +65
req, err := flagutil.BuildRequest[operations.StableTestTurnControllerCreateRequest](cmd, createCmdMeta, "Body", "body")
if err != nil {
if err = finishTurn(cmd, req, err); err != nil { // turnflags.go: --test-id gives the test; variableStates is [] unless given
Comment on lines +73 to +75
if get := sibling(cmd, "get"); get != nil && firstString(answer, "message") != "" {
return "", []ui.Tip{{Command: withScope(cmd, get.CommandPath()+alsoNeeded(cmd, get, "", sentType(cmd))), Does: "see it now"}} // nextneeds.go: the ID and the rest get requires, as the update was given them
}
Comment on lines +129 to +132
case f.Name == "body" || f.Name == "body-param":
var body struct{ Type string }
if json.Unmarshal([]byte(f.Value.String()), &body) == nil && body.Type != "" && sent["type"] == nil {
sent["type"] = body.Type
@linear-code

linear-code Bot commented Dec 2, 2026

Copy link
Copy Markdown

COR-16419

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants