Conversation
ianaya89
pushed a commit
that referenced
this pull request
Aug 26, 2021
ianaya89
pushed a commit
that referenced
this pull request
Aug 26, 2021
ianaya89
pushed a commit
that referenced
this pull request
Aug 26, 2021
thebiglabasky
added a commit
that referenced
this pull request
Apr 6, 2026
Wires AgenticCheck into the \`checkly import\` code generation flow so
users can import an existing agentic check from the backend and get a
construct file that matches the locked-down props type added earlier on
this branch.
Implementation:
- New \`AgenticCheckCodegen\` in \`agentic-check-codegen.ts\` mirroring the
Heartbeat/Browser codegen pattern. Places generated files under
\`resources/agentic-checks/{name}\`, imports \`AgenticCheck\` from
\`checkly/constructs\`, and emits a \`new AgenticCheck(...)\` expression.
- The resource shape (\`AgenticCheckResource\`) carries \`prompt\` and the
backend's \`agenticCheckData\` storage blob. A small helper reverse-
translates that blob into the CLI construct's public shape:
* \`agenticCheckData.skills\` → \`agentRuntime.skills\`
* \`agenticCheckData.selectedEnvironmentVariables\` → \`agentRuntime.environmentVariables\`
— mapping \`key\` back to \`name\` for object-form entries
* \`agenticCheckData.assertionRules\` → deliberately not emitted
(agent-generated, preserved server-side via the backend's merge
logic, the construct intentionally does not expose them)
An imported check with no skills and no selected env vars produces no
\`agentRuntime\` block at all, to avoid noise in the generated code.
- Registers the new codegen in \`CheckCodegen.constructor\` and wires
\`AGENTIC\` into the dispatch switches in \`describe()\` and \`gencode()\`
alongside the existing check types.
\`buildCheckProps\` gains a narrow \`BuildCheckPropsOptions\` parameter —
currently a single \`skipRetryStrategy\` flag — because \`retryStrategy\`
is the only field that \`buildCheckProps\` emits unconditionally (null is
rendered as \`RetryStrategyBuilder.noRetries()\`). The AgenticCheck
construct's props type omits \`retryStrategy\` entirely, so emitting it
would produce a generated file that does not type-check. The
AgenticCheckCodegen passes \`skipRetryStrategy: true\` and clears
\`locations\` from a resource copy before calling \`buildCheckProps\` — the
two fixes together make the generated output round-trip cleanly through
the construct's props type.
Verified end-to-end by extending \`ai-context/context.fixtures.json\` with
an example agentic check (prompt, skills, mixed-form env vars, sample
assertionRules) and running \`npm run prepare:ai-context\`. The generated
\`gen/resources/agentic-checks/example-agentic-check.check.ts\` contains
only fields the construct accepts, reverse-translates env vars from
\`key\` to \`name\`, omits \`assertionRules\`, and type-checks against the
construct. Full CLI suite remains green (829 passing / 2 skipped /
60 files). No regressions in any other check type's codegen from the
new optional options parameter.
Covers item #3 on Simo's new-construct checklist. Items #5 (examples),
#6 (E2E tests), and #8 (AI context reference doc) still pending on this
branch.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
I hereby confirm that I followed the code guidelines found at engineering guidelines
⚙️ Affected Components
📝 Notes for the Reviewer
check-statusesendpoint. Just runcheckly statuscheckTypefor instance🏗️ New Dependency Submission