Behaviour change: the in-process PowerShell engine now reports what the
script asked for, the way pwsh -File does.
- `exit 5` reports exit 5 and Failed. It used to report Succeeded, 0: an
AddScript exit reaches only the host's SetShouldExit, which nothing read,
so a small host now captures it. `exit 0` succeeds, even after errors.
- A native command's non-zero $LASTEXITCODE no longer fails a script unless
the script exits with it, and neither do errors it silenced (HadErrors is
set by both, so the error stream decides now).
- Write-Error still fails a script that never calls exit, with exit 1.
JobStatePayload gains optional ErrorType, ErrorId and ErrorMessage: the first
error's exception type, FullyQualifiedErrorId and message; for external
engines the first stderr line. Older agents omit them. It also gains RunId,
for the backend to set when relaying to browsers.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Output objects were sent as PSObject.ToString(), so anything that was not
already a string came back as a type name or a terse dump:
"System.Collections.Hashtable", "System.Diagnostics.Process (svchost)",
"@{Name=widget; Size=42}".
Both PowerShell engines now pipe the script's output through
`Out-String -Stream -Width 4096`, PowerShell's own formatter: objects
arrive as their table or list view (a hashtable's Name/Value rows,
properties as columns), still streamed line by line as they are produced,
wide enough that tables are not cut short with "…" at 80/120 columns.
Strings pass through unchanged; trailing padding is trimmed; the exit
code is unaffected. Bash output was already text.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Hashtable parameters no longer fix one key/value type for the whole
table: every entry picks its own primitives as it is added, carried as
native JSON and rebuilt by the agent from each element's own kind. That
change surfaced a latent binder bug — the int-downcast ternary widened
numbers back to long before boxing, so hashtable keys never matched
integer lookups — now fixed with explicit branches.
On-device expansion becomes the background default (ExpandEnvironment-
Variables then ExpandString, one pass), replacing the confusing per-mode
"On device" selector with a single Literal opt-out checkbox for values
where the raw text is the point. Stored definitions with removed enum
values degrade to no parameters instead of failing every script read.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Scripts can bind entries of a secrets dictionary to values held in an
external vault. The backend resolves every binding at dispatch time —
manual runs and triggered runs alike — and ships only the values, so
agents and browsers never hold vault credentials. The agent injects them
as a case-insensitive OrderedDictionary session variable (name
configurable per script, default Secrets), giving $Secrets.ApiKey in the
script body with declaration order preserved.
Infisical is the first driver (universal-auth machine identity, v3 raw
API); the ISecretsProviderDriver interface keeps the rest pluggable and
self-describing so the settings form renders from driver metadata.
Provider connection settings are a Data Protection-encrypted blob, secret
config fields never return to the browser, and the script editor's picker
lists secret names only. Resolution failures fail the job with a
value-free message naming the binding and provider.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Each parameter can opt into on-device expansion of its string values:
Environment (%VAR% via ExpandEnvironmentVariables) or PowerShell
($env:VAR and $() via $ExecutionContext.InvokeCommand.ExpandString in
the job's runspace, before the prelude runs). Applies to string scalars,
string array elements and hashtable values — keys stay literal. The
builder gains an "On device" selector and run inputs show a tag so the
operator knows the value resolves remotely.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>