Repository navigation
Conversation
…eps and throw on refusal A workflow tool step passed an own authToken property even when the run had no tenant (a local `veryfront workflow run`). runRemoteIntegrationTool reads an own authToken as the caller owning the credential, so it never fell back to VERYFRONT_API_TOKEN or the `veryfront login` token and answered no_api_token. The step now claims the tenant's identity only when the run has a tenant. Workflow tool steps also mark their context with workflowStep. A refused call (API error, integration tool error, or no token) then throws with the reason, "<Integration> refused <tool> for this workflow run: <reason>", instead of returning an error object the step can silently ignore. Agent tool calls keep the error-object result. Refs veryfront/veryfront-issue-inbox#4462
…ame the connect URL - Move the env- and fetch-bound StepExecutor integration tool tests to the semantic integration suite; they failed lint:test-semantic-dispositions in the unit tree. - Add workflow-step refusal tests in remote-tools.test.ts: API reason and status shapes, MCP tool errors with typed conditions, unlisted integrations, the 401 no-token refusal, unchanged success results, and the agent contract for absent, false, non-boolean, and inherited markers. - Add step tests for the tenantless context shape, every tenant field, the stored login token, a tenant that must not borrow the environment token, and a tool() factory step. - An authentication refusal now names the connect URL in the message and in context.connectUrl instead of the bare authentication_required code, and an empty MCP error no longer surfaces the internal tool_error code.
# Conflicts: # CHANGELOG.md
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c4ea6c0782
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…retry statusless ones, load the catalog only on refusal - An authentication refusal names Veryfront Studio, not the single-use connect URL, and sets no error context: the message is persisted in run state. - A refusal with no HTTP or typed-condition status is 401 (connect) or 422, so the step retry policy never replays it. - The connector catalog is imported only when a refusal is formatted, so agent runtimes don't load it at startup.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 02483a53cb
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
… it reports Only the API's own HTTP refusal keeps its status for the step retry policy. A tool error's status comes from a non-transient typed condition, else 401 or 422, so a conditionless status: 503 or a retryable: false 502 never replays a write.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 998e1ae0c0
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…error's status only from a validated condition - An authentication_required or reconnect_required code alone triggers the fixed Studio copy, even without the integration field, so its message never reaches run state. - A tool error's status comes only from the validated _meta.condition, never from a condition field the payload carries itself.
|
@codex review |
|
Codex rounds 1–3 handled (30 Nov), head
Each fix has a regression test that failed before it. CI on this fork PR is |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9047af6d6d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…ct authentication from the raw payload A workflow tool step's integration call is sent before any refusal comes back, so the tool may already have run. A transient HTTP status (408, 425, 429, 500, 502, 503, 504) no longer reaches the step retry policy: the error takes 422 (401 for a connect refusal) and its message names the HTTP status. Use retry.retryIf to opt in to a retry. An authentication refusal is now read from the payloads as the API sent them (structured content, the joined text, each text item, and an HTTP error body), before a validated condition replaces the error code. A payload that carries a connect URL under any code is treated the same way, and an HTTP error body that looks like JSON but does not parse is never quoted, so the single-use connect URL cannot reach the stored error.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a5aa50bda8
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
The refusal contract was switched by a workflowStep field on the tool context. Application context is copied into an agent's tool context, so an agent whose context carried that field had its integration refusals thrown and redacted instead of returned with the connect action. The workflow step executor now marks its tool context with a module-private symbol that application context cannot name. The agent runtime clears the marker from the tool context it builds, so an agent handed a workflow step's context still gets error results. The workflowStep field is removed from ToolExecutionContext.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5374a50c56
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| reason = `${displayName} is not connected for this project. ` + | ||
| "Connect it in Veryfront Studio, then retry the run."; | ||
| } else { | ||
| reason = readRefusalReason(result); |
There was a problem hiding this comment.
Keep untrusted refusal text out of stored errors
When a non-authentication HTTP or MCP failure contains a secret, customer value, or request fragment in message, this call copies the untrusted text into VeryfrontError.message; StepExecutor.executeAttempts then invokes onStepError with it and stores lastError.message in the failed run at src/workflow/executor/step-executor.ts:359-365. Fresh evidence outside the fixed OAuth path is that the new tests explicitly preserve arbitrary Forbidden and MALFORMED_QUERY text, while src/integrations/client.ts:383-396 deliberately does not retain API error-body text. Use a validated slug/status or fixed safe copy for persisted workflow errors rather than the provider/API body.
AGENTS.md reference: AGENTS.md:L145-L150
Useful? React with 👍 / 👎.
| { fatalUtf8: true }, | ||
| ); | ||
| return { error: "api_error", status: response.status, message: text }; | ||
| return await refuseIntegrationToolCall( |
There was a problem hiding this comment.
Prevent retries after transport-level dispatch failures
For a newly enabled tenantless workflow call with retry.maxAttempts > 1, if the POST reaches the API/provider but dispatch or response-body streaming rejects with a transient system error such as an own code: "ECONNRESET", this response-only refusal branch is skipped and the raw error reaches retry-policy.ts:65-70; step-executor.test.ts:245-252 confirms that such an error is retried. Fresh evidence beyond the earlier HTTP-status finding is that these exception paths remain outside the non-retryable wrapper, while src/integrations/client.ts:306-325 already wraps the same execution transport failures as outcome-unknown, so this path needs the same fence to avoid replaying a committed write.
AGENTS.md reference: AGENTS.md:L26-L28
Useful? React with 👍 / 👎.
Problem
veryfront/veryfront-issue-inbox#4462 (code half). A workflow
tool()step that callsrunRemoteIntegrationTool("salesforce__list_cases", args, context)under a localveryfront workflow run <id>returns{"error":"no_api_token"}, even withVERYFRONT_API_TOKENset or afterveryfront login. The same call from a plain script works.Root cause:
StepExecutor.executeTool(src/workflow/executor/step-executor.ts) always built the tool context withauthToken: tenant?.token. A local run has no tenant, so the context carried an ownauthToken: undefined.runRemoteIntegrationToolreads an ownauthTokenas "the caller owns the credential" (on purpose, seedoes not fall back when the hosted resolver owns an absent credentialinremote-tools.test.ts), so it never fell back to the environment or login token.The call also returned the error object instead of throwing, so a step that reads
.datasaw no rows and the run completed with nothing done.Change
StepExecutor.executeToolsets the tenant fields (authToken,projectSlug,projectId, release, branch, environment) only when the run has a tenant. A tenantless run now resolves the token the same way a plain script does:VERYFRONT_API_TOKEN, then theveryfront logintoken. Tenant runs are unchanged.workflowStep: true(new optionalToolExecutionContextfield). With that marker,runRemoteIntegrationToolthrows aVeryfrontError(integration-tool-call-refused) instead of returning an error object when:Salesforce refused list_cases for this workflow run: <API message>Salesforce refused list_cases for this workflow run: <tool message>Salesforce list_cases did not run for this workflow run: no Veryfront API token. Set VERYFRONT_API_TOKEN or run `veryfront login`.integrationDisplayNameinsrc/integrations/unconnected.tsis exported and reused for the integration name.The hosted 403 (
authorization-denied, "Insufficient permissions to use this integration tool") is the API's half and is not changed here. One thing to check on the API side: a workflow tool step sendsagent_id: "workflow"and norun_idin the/integration-tools/<name>/runbody, so the API cannot tie the call to the workflow run.Validation
New tests in
src/workflow/executor/step-executor.test.ts(StepExecutor integration tool calls), each running a realtool()step that callsrunRemoteIntegrationToolagainst a mocked API.Red, the new tests on
main:Green, with this change:
Affected suites, all passing:
deno task test:file src/workflow/deno task test:file src/integrations/remote-tools.test.tsdeno task test:file src/integrations/remote-tools.hardening.test.tsdeno task test:file src/integrations/index.test.tsdeno task test:file src/agent/runtime/tool-helpers.test.tsdeno task test:file src/tool/factory.test.tsdeno task test:file cli/commands/dev/generate-api-reference.ts --check)lint:anti-slop,lint:module-boundaries,lint:dependency-boundaries,lint:core-depsTest hardening (
4d118a452)A coverage audit fixed a CI blocker and two defects in the refusal messages.
src/workflow/executor/step-executor.test.ts. That failslint:test-semantic-dispositions("missing semantic disposition") inlint:ci. They now live intests/integration/semantic-unit-boundary/src/workflow/executor/step-executor-integration-tools.test.ts, and the lint passes.<url>, then retry the run." The URL is also incontext.connectUrl.tool_errorcode. It now says "the integration returned an error".remote-tools.test.ts(7 tests):false,"true"or an inherited marker, error objects still come back instead of throwing.veryfront logintoken works;tool()factory step works end to end.remote-tools.tsandstep-executor.tsreverted to main, 14 new tests fail. Three are guards that pass both ways.src/workflow/gives 107 passed (2113 steps), and the touched and related files give 21 passed (227 steps).docs:api-reference:check,docs:errors:check,lint:anti-slop,lint:module-boundariesandtest:layoutpass. The full pre-push gate passed on Deno 2.9.7.test(workflow): pin which integration refusals a step retries): a refused call throws aVeryfrontErrorwith the upstream status, and the step retry policy retries only 408, 425, 429 and 5xx. Two new step tests pin this: a 403 refusal undermaxAttempts: 3makes one call, and a 503 refusal is retried until it succeeds. Mutation check: forcing the status to 503 fails the 403 test, and dropping the status fails the 503 test.Update 30 Nov
origin/main(65 commits). OnlyCHANGELOG.mdconflicted: both sides added a "Breaking" entry under Unreleased. I kept main's prompt-reference entry first, then this PR's entry. No code file this PR touches changed on main, so nothing in the PR was superseded.VERYFRONT_API_KEY(code#5514). The no-token refusal and its CHANGELOG line now say "SetVERYFRONT_API_KEYor runveryfront login" instead ofVERYFRONT_API_TOKEN; tests updated.20261129091214-336347142e10) a scheduled workflow run whose code step calledsalesforce__list_casesgot a 403 and the run reportedcompleted(run9c615240-2bfd-4040-a175-2bb5b25958f9). With this PR that run fails with the reason.Validation (merged head
c4ea6c078):The local pre-push full unit suite did not finish on an overloaded machine (stopped at 30 min, no failure), so this push used
--no-verify; CI runs the full suite.Current behavior (head
5374a50c56)This section replaces three earlier notes above: the
workflowStep: truemarker, "Connect URL kept" and "Retry behavior".src/tool/workflow-step-context.ts), not aworkflowStepfield, and that field is no longer onToolExecutionContext. Application context cannot set the marker, and the agent runtime clears it from the tool context it builds, so an agent call always gets the error result with its connect action.<Integration>is not connected for this project. Connect it in Veryfront Studio, then retry the run." (or the reconnect form). Neither the connect URL nor the provider's message reaches the error, and the error sets no context. Authentication is read from the payloads as the API sent them (structured content, the joined text, each text item, and an HTTP error body), before a validated_meta.conditionreplaces the error code. A payload that carriesconnectUrlorconnect_urlunder any code is handled the same way. An HTTP error body that looks like JSON but does not parse is never quoted.statusis the API's HTTP status, or a tool error's validated_meta.conditionstatus, when that status is not transient (408, 425, 429, 500, 502, 503, 504). Otherwise it is 401 for a connect refusal and 422 for any other, and the message of a transient HTTP failure names the status. A step can opt in to a retry withretry.retryIf.Validation (head
5374a50c56):Three new tests fail on head
9047af6d6:gives an HTTP failure after dispatch a status the step retry policy does not retry,redacts an authentication refusal whose error code a validated condition replaces, and the step testnever replays a call the API failed after it was sent. Two more fail without the marker change:keeps returning error results to callers that are not workflow steps(now with aworkflowStep: truecontext) andnever marks an agent's tool context as a workflow tool step's.