fix: remove duplicate const declarations, fix broken test/contracts/config — closes #38#56
Open
rishab11250 wants to merge 1 commit into
Conversation
…s/config files Closes NEXARA-oss#38 Fixes 6 bugs: - runtime.ts: delete duplicate first-draft loop causing SyntaxError - runtime.ts: fix runStepWithRetry caller args (wrong tenantId/correlationId) - runtime.ts: fix runStep method signature (orphaned params, double return type) - runtime.ts: add missing tenantId to startSpan call in second loop - contracts/index.ts: remove duplicate kind field dropping 'memory'/'trigger' - config.ts: remove merge artifact and duplicate AUTH_DISABLED - runtime.test.ts: close unclosed test blocks, remove duplicate imports
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.
Description
Fixes issue #38 — the
WorkflowRuntime.execute()method crashed at parse time due to duplicateconstdeclarations. Also fixes 5 additional bugs introduced by PRs #33 and #34 that left the code in a broken state.Changes
packages/core/src/lib/runtime.ts(4 fixes)const stateandconst results, but kept the original retry-enabled loop below it with identical declarations. This causedSyntaxError: Identifier 'state' has already been declared.workflow.startedevent — relocated from the deleted loop to the retry-enabled loop so the event is still published.runStepWithRetrycaller args — was passingargs.correlationIdas thetenantIdparameter andattemptascorrelationId. All step events (tool.called,llm.requested) had wrong tenant and correlation IDs.runStepmethod signature — had orphaned parameter declarations and two): Promise<...> {return-type declarations, making it invalid TypeScript.tenantIdto thestartSpancall in the second loop — the call was missing this required field, causing Zod validation failures.packages/contracts/src/index.ts(1 fix)kindfield intraceSpanSchema— the schema had twokinddeclarations. The second (narrower) one overwrote the first, silently dropping'memory'and'trigger'span types from validation.packages/core/src/lib/config.ts(1 fix)issue-30-auth-disabled-falsebare string literal.AUTH_DISABLEDdeclaration —z.coerce.boolean().default(true)was overriding thebooleanEnvpreprocessor.packages/core/src/lib/runtime.test.ts(1 fix)it()anddescribe()blocks — the first test suite was never terminated, causing a parse error.ExecutionSnapshot,TraceSpan,PulseInfra) into the top-level import block.Testing
@pulsestack/contractsand@pulsestack/core)main— branchfix/issue-38-duplicate-const-declarationsonlyRelated Issues