dx: worker authoring run-proxy template, init/validate parity, cold-start docs#2259
Draft
federicodeponte wants to merge 1 commit into
Draft
dx: worker authoring run-proxy template, init/validate parity, cold-start docs#2259federicodeponte wants to merge 1 commit into
federicodeponte wants to merge 1 commit into
Conversation
- add a Gmail run-proxy template and contract documentation\n- harden golden templates with validated use cases\n- test every init-to-validate template round trip\n- guide repeated CLI use toward a global install
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Addresses Floom CLI developer-experience feedback (tickets
6b210a25,af6f3190), items 1-3 implemented, item 4 written up as a proposal below (not implemented — out of scope for this PR).composio-proxygolden template (floom workers templates get composio-proxy) with a workingrun.pythat readsconnections.json, POSTs to{WORKEROS_API_URL}/runs/{FLOOM_RUN_ID}/composio-execute/{slug}with theX-Floom-Run-Tokenheader, and declaresconnections: [{app: gmail, allowed_tools: [...]}]inworker.yml. The pattern mirrors the real dogfoodedworkers/gmail_inbox_manager/run.py.floom workers contract(both--jsonand human-readable output) now documents the run-proxy contract: injected env vars,connections.jsonshape, request method/URL/header/body, and a pointer to the new template. Also exempted the three runner-injected env vars (WORKEROS_API_URL,FLOOM_RUN_ID,WORKEROS_RUN_TOKEN) from the "undeclared secret" validator, since worker authors never declare them.use_casesentries to all four golden templates (python-script,gmail-summary-agent,approval-script,composio-proxy) sofloom initoutput is self-consistent withfloom workers validate. Note: on currentmain(cb3a071f7),use_casesis optional both client-side (validateWorkerContractShape) and server-side (WorkerContract.validate_use_cases), so the literal "use_cases must contain 3 to 5 items" failure could not be reproduced from a freshfloom inittoday — templates without the field simply skip that check. This PR still addsuse_casesto every template since (a) it matches the field already present in real production workers likegmail_inbox_manager, and (b) it is the explicit deliverable requested (3-5 placeholder use_cases, correct schema_version 0.3 exec block). Added a regression test (apps/mcp/test/init-validate-roundtrip.test.js) that round-trips every template throughinit->workers validateand asserts zero errors, so any future drift between the two commands fails CI immediately.apps/mcp/README.mdand the rootREADME.mdpointing agents/automation atnpm i -g @floomhq/floom@latestinstead of repeatednpx -y @floomhq/floom@latest. Added a soft (non-blocking)floom doctorcheck that detects npx-cache invocation and hints at the global install.Item 4 proposal (not implemented): short human-friendly IDs
Investigated feasibility of replacing raw UUIDs in worker/run URLs with short IDs.
What I found in
apps/web/app:runs/[id],run/[id], andworkers/[id]all resolveparams.iddirectly against the UUID primary key — no short-ID layer today.support/[id]route exists in this repo; support tickets, if UUID-exposing, likely live in a separate system outsidefloomhq/floomand are out of scope for this proposal.apps/web/app/[handle]/[workerSlug]/page.tsxresolves public worker pages via@{workspace.handle}/{worker.public_slug}instead of a UUID, decodingparams.handle/params.workerSlugand looking up the record by that composite key.Proposed approach:
run_xxxxxxxxor Linear'sFLM-1042) as a generated, indexed, non-primary column onrunsandworkersat insert time. Keep the UUID as the real primary key and foreign-key target everywhere else — this avoids touching any existing FK relationships or the run-proxy contract (FLOOM_RUN_IDstays a UUID internally).[id]route handlers: try the short ID first (cheap indexed lookup), fall back to UUID for old/bookmarked links so nothing breaks.workers get/runs getoutput, dashboard nav) to prefer the short ID once populated; UUID remains valid indefinitely for backward compatibility.Sizing: touches
apps/api(migration + resolver),apps/web(route handlers + link generation ~3-4 files), andapps/mcp(output formatting forworkers get/runs get, optional). Estimate: medium — a few days, not a one-line change — so left as this written proposal rather than implemented here, per the task's guidance to write up large item-4 changes instead of shipping them.Test plan
npm run build(tsc) — clean, zero errorsnpm test— 171/171 passing (including newinit-validate-roundtrip.test.js)python-script,gmail-summary-agent,approval-script,composio-proxy) passfloom init --template <id>->floom workers validatewithvalid: true, errors: []floom workers contract --jsonincludes the newrun_proxykey; human-readable output prints the new "Run-proxy (Composio/Gmail) contract" sectionfloom workers templates get composio-proxy --jsonround-tripsworker_yml+run_py🤖 Generated with Claude Code