Open
Conversation
* update deps * allow infinite retries with negative attempts * Add agent cancellation mechanism via @public cancelAgent workflow Introduces an in-memory cancellation registry (Set<string> of chatIds) checked at every retry/loop checkpoint in the agent execution pipeline. When a chatId is cancelled, an AgentCancelledException is thrown to cleanly unwind the agent. - Add cancelledChatIds set, AgentCancelledException, cancelAgent/checkCancelled functions and @public cancelAgent event/workflow to agentlang.ai module - Add cancellation checks in agentInvoke() retry loops and iterateOnFlow() loops - Re-throw AgentCancelledException in flow retry catch to prevent swallowing - Allow negative retry attempts in Retry constructor for infinite retry support - Add unit tests for cancellation registry and infinite retry Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Replace in-memory agent cancellation with DB-backed CancelledAgent entity --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* Allow user-provided values to override @expr on entity creation and upsert Previously, @expr attributes always overwrote user-provided values on entity creation and upsert, even when the user explicitly set a value. On update, user values correctly took precedence due to the origAttrs re-evaluation loop in computeExprAttributes(). This fix passes the CRUD body attributes and instance attributes into computeExprAttributes() on the creation path so that user-provided values for @expr attributes are restored after expression evaluation, matching the update behavior. The origAttrs loop is also scoped to only re-evaluate attributes that have @expr defined, preventing unintended overwrites of post-processed values like hashed passwords. * Fix chained @expr evaluation to use user-provided overrides inline Previously, user-provided values for @expr attributes were applied in a separate loop after all expressions had been evaluated. This meant dependent expressions would use the expr-computed value instead of the user's override. For example, with y @expr(x+1) and z @expr(y*2), overriding y=100 would still compute z from expr's y, not the user's. This refactors computeExprAttributes() to collect user overrides upfront and apply them inline during the expr evaluation loop. When a user provides a value for an @expr attribute, that value is used instead of evaluating the expression, and subsequent dependent expressions see the override immediately. * Add @expr tests for helper functions with sibling and related entity params Test that @expr can call helper functions with sibling entity attributes as parameters (including @optional), and that path-referenced attributes from related entities are correctly resolved as function arguments. * Support @expr references through between-relationships Add the ability for @expr attributes to navigate through declared between-relationships to access attributes on related entities, e.g. DeptEmployee.Department.BudgetMultiplier. - Add extractRefsFromExpr() utility that walks the expression AST to collect all dot-separated references - Add validateExprRelationshipRefs() in loader to validate relationship references at module internment time (rejects many-to-many, one-to-many from "one" side, and invalid entity aliases) - Extend computeExprAttributes() to resolve related instances via fast path (betweenRelInfo from env) and slow path (queryConnectedInstances) - Add tests for one-to-many, one-to-one, update recomputation, and three negative validation cases * Consolidate and rename test helper functions in expr-attr tests Removed duplicate function definitions (adjustSalaryRel, adjustSalaryUpd, adj3, count1, getName2, makeDisplay11) by reusing shared implementations (adjustSalary__test, identity__test, makeDisplay__test). Added __test suffix to all test helper functions to avoid collisions with real agentlang functions. * Agent cancellation (#616) * update deps * allow infinite retries with negative attempts * Add agent cancellation mechanism via @public cancelAgent workflow Introduces an in-memory cancellation registry (Set<string> of chatIds) checked at every retry/loop checkpoint in the agent execution pipeline. When a chatId is cancelled, an AgentCancelledException is thrown to cleanly unwind the agent. - Add cancelledChatIds set, AgentCancelledException, cancelAgent/checkCancelled functions and @public cancelAgent event/workflow to agentlang.ai module - Add cancellation checks in agentInvoke() retry loops and iterateOnFlow() loops - Re-throw AgentCancelledException in flow retry catch to prevent swallowing - Allow negative retry attempts in Retry constructor for infinite retry support - Add unit tests for cancellation registry and infinite retry Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Replace in-memory agent cancellation with DB-backed CancelledAgent entity --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> * fix warn * update deps * fix local-ref in expressions regression * fix postgres test failures related to table naming, uq constraints etc * fix undefined ai-config lookup bug --------- Co-authored-by: Vijay Mathew <73871437+vijayfractl@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Vijay Mathew <vijay@fractl.io>
…602) * Allow user-provided values to override @expr on entity creation and upsert Previously, @expr attributes always overwrote user-provided values on entity creation and upsert, even when the user explicitly set a value. On update, user values correctly took precedence due to the origAttrs re-evaluation loop in computeExprAttributes(). This fix passes the CRUD body attributes and instance attributes into computeExprAttributes() on the creation path so that user-provided values for @expr attributes are restored after expression evaluation, matching the update behavior. The origAttrs loop is also scoped to only re-evaluate attributes that have @expr defined, preventing unintended overwrites of post-processed values like hashed passwords. * Fix chained @expr evaluation to use user-provided overrides inline Previously, user-provided values for @expr attributes were applied in a separate loop after all expressions had been evaluated. This meant dependent expressions would use the expr-computed value instead of the user's override. For example, with y @expr(x+1) and z @expr(y*2), overriding y=100 would still compute z from expr's y, not the user's. This refactors computeExprAttributes() to collect user overrides upfront and apply them inline during the expr evaluation loop. When a user provides a value for an @expr attribute, that value is used instead of evaluating the expression, and subsequent dependent expressions see the override immediately. --------- Co-authored-by: Vijay Mathew <vijay@fractl.io>
fractlrao
approved these changes
Mar 7, 2026
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.
No description provided.