Skip to content

refactor(core): store task locals in context - #99

Merged
medz merged 1 commit into
mainfrom
refactor/unified-task-context
Oct 25, 2026
Merged

medz merged 1 commit into
mainfrom
refactor/unified-task-context

Conversation

@medz

@medz medz commented Oct 25, 2026

Copy link
Copy Markdown
Member

Summary

Store TaskLocal overrides under private typed keys in the execution Context. Reuse service reads and local Context provision, removing the separate locals map, evaluator instructions, restoration frames, and environment capture arguments. Request partitioning now compares the unified bindings once.

The public API is unchanged:

final requestId = TaskLocal('unknown', name: 'requestId');
final program = requestId
    .locally('request-42', requestId.get())
    .flatMap((inside) => requestId.get().map((outside) => (inside, outside)));
// Returns (request-42, unknown).

Default reads do not create bindings. Explicit null and explicit default overrides retain their identity and isolation; child executions, finalizers, and shared acquisitions keep their captured environment.

Related issues

Closes #67

Validation

  • dart pub get
  • dart format --output=none --set-exit-if-changed .
  • dart analyze --fatal-infos
  • dart test — 1,351 tests passed
  • Added coverage for service/local provider composition and default-vs-explicit request isolation; strengthened failure/cancellation restoration and identity comparisons.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-25T11:12:13.194152Z a8232c6 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@medz medz added the enhancement New feature or request label Oct 25, 2026 — with ChatGPT Codex Connector

medz commented Oct 25, 2026

Copy link
Copy Markdown
Member Author

@codex review

@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: a8232c65fa

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@medz
medz merged commit 926c420 into main Oct 25, 2026
2 of 3 checks passed
@medz
medz deleted the refactor/unified-task-context branch October 25, 2026 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Store TaskLocal bindings in the shared execution Context

1 participant