Repository navigation
[APPS-2961] Update: run local backend function calls in parallel, with per-call log prefixes - #603
Conversation
Live Debugger Runtime BenchmarkBenchmark results were not produced. Check the workflow logs for details. |
1b04081 to
cfac113
Compare
cfac113 to
401268c
Compare
|
@codex review |
Codex Review SummaryThis 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 401268c033
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
🟢 Approval recommended
No blocking issues were identified in concurrency accounting, query sharing, error handling, logging, or regression coverage.
No open issues 🎉
What changed in this PR
Builds on process isolation to run local backend calls concurrently on Vite 6+, while preserving serial execution for the in-process fallback.
Changes:
- Allows up to 25 concurrent calls, returning HTTP 429 when full.
- Adds per-call log prefixes and shares in-flight runtime-context queries.
- Updates regression tests and local-execution documentation.
| File | Description |
|---|---|
| packages/plugins/apps/src/vite/local-execution.ts | Makes the in-process queue helper private. |
| packages/plugins/apps/src/vite/local-execution-process.ts | Adds concurrency limits and per-call log prefixes. |
| packages/plugins/apps/src/vite/local-execution-process.test.ts | Tests parallelism, slot release, isolation, and logging. |
| packages/plugins/apps/src/vite/dev-server.ts | Shares context queries and handles HTTP 429 responses. |
| packages/plugins/apps/src/vite/dev-server.test.ts | Tests query sharing, refresh, and concurrency errors. |
| packages/plugins/apps/README.md | Documents concurrent execution and prefixed logs. |
Review effort: Balanced
oliverli
left a comment
There was a problem hiding this comment.
Approved. The change is correct. I added two optional nits.
401268c to
002f14e
Compare
f698ad5 to
7e9b4b4
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
7e9b4b4 to
cf49bfa
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
cf49bfa to
314d9ca
Compare
314d9ca to
86c8430
Compare
🎉 All green!🧪 All tests passed 🔗 Commit SHA: b50260f | Docs | View more details | Give us feedback! |
…l log prefixes Each call already gets a fresh process, so calls no longer queue and run in parallel, with no local limit: production's concurrency limits vary by org, and dev:verify runs against them. Calls that start together share one runtime context query, so a burst sends Datadog one query instead of one per call. Each line a call writes is prefixed with its function name and call number. A failed $.Actions call now rejects as it does in a deployed app: with a bare string holding the platform's error detail, the deployed inputs or no-arguments message, or the local allowlist message, not an Error. An uncaught failure in the function's code reports as it does in a deployed app: the dev server's error is "Execution failed: " followed by the thrown Error's stack or the thrown value, and the dev transport throws that message instead of the status and raw response body. Refs: APPS-2961 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
86c8430 to
b50260f
Compare

Motivation
Architecture
sequenceDiagram participant App as App frontend (dev client) participant D as Vite dev server participant C1 as Call 1 process participant C2 as Call 2 process participant API as Datadog API App->>D: executeAction (call 1) App->>D: executeAction (call 2) D->>API: One runtime-context lookup, shared by both calls API-->>D: Runtime context ($) par Calls run in parallel, no local limit D->>C1: start C1-->>D: Log lines, printed as [fn#35;1] ... and D->>C2: start C2-->>D: Log lines, printed as [fn#35;2] ... end C1->>D: $.Actions call fails D-->>C1: Rejects with the platform's bare string C1->>D: result D-->>App: 200 with the result C2->>D: Uncaught error D-->>App: 500 {error: "Execution failed: #lt;message#gt;"} Note over App: The dev client throws BackendFunctionError("Execution failed: #lt;message#gt;")Changes
10 changes across local-execution-process.ts, dev-server.ts, local-execution-shared.ts, dev-server-transport.ts, the README and tests
local-execution-process.ts[fn#N].local-execution-process.tslocal-execution-process.tsdev-server.ts$.Actionscall with the platform's bare string.dev-server.tsExecution failed: <stack or value>.dev-server.ts$.Actionscalls with deployed-wording strings.local-execution-shared.tserror, else the status and body.dev-server-transport.tsREADME.mdlocal-execution-process.integration.test.ts,dev-server.test.ts,execute-backend-function.test.tsQA Instructions
Apps local executionjobs in the CI matrix PR's CI run, which includes this branch.a connection is required for …No arguments provided …, or… must have an inputs field that is an objectrpc error: code = NotFound …BackendFunctionError:Execution failed: <message or stack>Fixtures, helper scripts and raw output
executeBackendFunction:Blast Radius
dev:verifyincluded.Out of Scope / Follow-ups
1 item deferred
[fn#N]prefix.Documentation
🤖 Generated with Claude Code