-
Notifications
You must be signed in to change notification settings - Fork 3.7k
feat(custom-blocks): log and bill child runs in the publisher's workspace #6023
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
TheodoreSpeaks
wants to merge
14
commits into
staging
Choose a base branch
from
feat/custom-block-log
base: staging
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,307
−371
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
018873f
feat(custom-blocks): log and bill child runs in the publisher's works…
TheodoreSpeaks 3d2cac2
fix(custom-blocks): sanitize every boundary failure and classify it f…
TheodoreSpeaks dd9748f
fix(custom-blocks): surface a cancelled child as cancelled, not a gen…
TheodoreSpeaks 57d4e2b
fix(custom-blocks): share one large-value id list so nested blocks pr…
TheodoreSpeaks c5c5d3e
fix(custom-blocks): add a durable cancel backstop to the child bridge
TheodoreSpeaks de8eddd
fix(tools): carry Sim's own status through the tool-response boundary
TheodoreSpeaks 1923fe7
fix(custom-blocks): stop forwarding the publisher's personal quota to…
TheodoreSpeaks 0c4e959
fix(custom-blocks): correlate agent-tool runs to the real invoking ex…
TheodoreSpeaks 7b5590a
fix(custom-blocks): plumb the invoking execution id and abort signal …
TheodoreSpeaks 67805cb
fix(agent): forward the execution id through the provider payload
TheodoreSpeaks 891e02e
fix(executor): stop adopting an upstream target's HTTP status as our own
TheodoreSpeaks 8c8ffc1
fix(custom-blocks): drain child log finalization when the parent is c…
TheodoreSpeaks 264bc74
fix(custom-blocks): require curated outputs instead of exposing the w…
TheodoreSpeaks b345750
fix(custom-blocks): track the whole child run, not just its finalization
TheodoreSpeaks File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| /** | ||
| * Machine-readable class of a custom-block failure. Every member describes a | ||
| * fact the CONSUMER already knows or can act on — never the source workflow's | ||
| * blocks, tools, or upstream provider responses. | ||
| */ | ||
| export type CustomBlockErrorType = | ||
| | 'missing_inputs' | ||
| | 'not_deployed' | ||
| | 'unavailable' | ||
| | 'depth_limit' | ||
| /** | ||
| * The payer had no usage headroom, so the child never ran. Safe to surface: | ||
| * a custom block always resolves within the consumer's own organization, so | ||
| * the exhausted limit is their org's, not a foreign publisher's. | ||
| */ | ||
| | 'usage_limit' | ||
| /** The child run was cancelled (the invoking run aborted or was cancelled). */ | ||
| | 'cancelled' | ||
| | 'execution_failed' | ||
|
|
||
| /** What a failed custom block tells its consumer. Leaks nothing about the source run. */ | ||
| export interface CustomBlockFailure { | ||
| /** Stable, machine-readable class of the failure. */ | ||
| errorType: CustomBlockErrorType | ||
| /** Opaque handle to the child run, so the publisher can find the exact failing execution. */ | ||
| ref?: string | ||
| /** Consumer-safe sentence. Generic unless the throw site was a {@link BoundarySafeError}. */ | ||
| message: string | ||
| } | ||
|
|
||
| /** | ||
| * An error whose `message` names only the CALLER's own artifacts — the block | ||
| * they placed, its input labels, its deployment state — so it may cross an | ||
| * invocation boundary verbatim. | ||
| * | ||
| * Every error that is NOT of this class is opaque at the boundary. The default | ||
| * is fail-closed, so a `throw new Error(...)` added later anywhere in the | ||
| * custom-block path is redacted without anyone remembering to redact it. This | ||
| * replaces the older convention of throwing *before* the `try` block to dodge | ||
| * the catch's sanitizer, where redaction depended on lexical position. | ||
| */ | ||
| export class BoundarySafeError extends Error { | ||
| readonly errorType: CustomBlockErrorType | ||
|
|
||
| constructor(options: { message: string; errorType: CustomBlockErrorType }) { | ||
| super(options.message) | ||
| this.name = 'BoundarySafeError' | ||
| this.errorType = options.errorType | ||
| } | ||
| } | ||
|
|
||
| export function isBoundarySafeError(error: unknown): error is BoundarySafeError { | ||
| return error instanceof BoundarySafeError | ||
| } |
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.