EPILIBS-211: Task create contract — payload.target, failSafeTermination type, privilege docs#167
EPILIBS-211: Task create contract — payload.target, failSafeTermination type, privilege docs#167mpqmpqm wants to merge 1 commit into
Conversation
- payload.target ('APPLICATION' | 'PROXY', EPICENTER-6729) is now typed on
create and on the read view (lowercase echo); previously it only passed
through the payload spread, forcing TS callers to dodge excess-property
checks.
- failSafeTermination typed string (ISO-8601) to match the wire format the
server consumes and echoes; it was typed number while the docs already
said ISO-8601.
- Docstrings said 'requires support level authentication'; the Task API is
facilitator-gated. Also documented how the runner constructs the fire URL
from the relative payload.url and target.
Verified against epicenter-sandbox-1: created a task with target 'PROXY'
and an ISO failSafeTermination via the built lib, both echoed correctly.
EPILIBS-211
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request introduces an optional target field to HTTP task payloads, allowing tasks to target either the application or a proxy server. It also updates the documentation to reflect that task operations require facilitator privileges, changes the failSafeTermination option type from a number to an ISO string, and adds corresponding unit tests. The review feedback recommends allowing both uppercase and lowercase values for the input target types to prevent TypeScript compilation errors when developers attempt to reuse or round-trip retrieved payloads.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| objectType: 'http'; | ||
| method: string; | ||
| url: string; | ||
| target?: 'APPLICATION' | 'PROXY'; |
There was a problem hiding this comment.
Since the read view (HttpTaskPayloadReadOutView) returns lowercase values ('application' | 'proxy'), typing the input strictly as uppercase ('APPLICATION' | 'PROXY') will cause TypeScript compilation errors when developers attempt to round-trip or reuse a retrieved payload. To improve developer experience and allow flexibility, consider allowing both uppercase and lowercase values in the input types.
| target?: 'APPLICATION' | 'PROXY'; | |
| target?: 'APPLICATION' | 'PROXY' | 'application' | 'proxy'; |
| payload: { | ||
| method: string; | ||
| url: string; | ||
| target?: 'APPLICATION' | 'PROXY'; |
There was a problem hiding this comment.
Since the read view (HttpTaskPayloadReadOutView) returns lowercase values ('application' | 'proxy'), typing the input strictly as uppercase ('APPLICATION' | 'PROXY') will cause TypeScript compilation errors when developers attempt to round-trip or reuse a retrieved payload. To improve developer experience and allow flexibility, consider allowing both uppercase and lowercase values in the input types.
| target?: 'APPLICATION' | 'PROXY'; | |
| target?: 'APPLICATION' | 'PROXY' | 'application' | 'proxy'; |
What
Contract catch-ups in
taskAdapter(EPILIBS-211):payload.target('APPLICATION' | 'PROXY', EPICENTER-6729) typed oncreateand both HTTP payload views (read view echoes lowercase). Previously it only worked by sneaking through the payload spread; TypeScript callers had to pre-declare objects to dodge excess-property checking.failSafeTermination:number→string(ISO-8601) — the wire format the server consumes and echoes, and what the docstring already claimed. Callers today carrytoISOString() as unknown as numbercasts.@Facilitator-gated end to end. The old wording pushes integrators toward unnecessary shared-secret proxy plumbing. Also documented thatpayload.urlis relative and how the runner builds the fire URL ({host}{targetPath}/{account}/{project}{url}).Verification
npm run test:run: 1001 passed, including new specs assertingtargetpasses through to the request body (and is absent when omitted); optionals spec now sends an ISO-8601failSafeTermination.npm run type-checkclean.dist/cjs, created a task on epicenter-sandbox-1 withtarget: 'PROXY'and an ISOfailSafeTerminationusing a facilitator session — server echoedtarget: 'proxy'and the ISO timestamp; probe task destroyed afterward.Notes
failSafeTermination: number → stringis a type-level break for TS callers who passed epoch millis; the ISO string is the only wire format we have verified working against the live API.🤖 Generated with Claude Code