feat(agent): record the origin that entered dynamic workflow mode - #50
Merged
Conversation
Record the origin of the prompt that entered Dynamic Workflow mode, so a fan-out started by a scheduled job or hook is attributable in the session records. The RPC triggers run between turns and record no origin.
|
Caution Review failedAn error occurred during the review process. Please try again later. Comment |
commit: |
Merged
elkaix
pushed a commit
that referenced
this pull request
Aug 9, 2026
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @pythoughts/pythinker-code@0.14.0 ### Minor Changes - [#51](#51) [`c8cdcc7`](c8cdcc7) - `/workflow save` accepts `--personal` to save into the home skills directory, resolves the repository root when saving from a subdirectory so the saved skill is discoverable, and persists the workflow size guideline into the saved skill. ### Patch Changes - [#46](#46) [`bceff21`](bceff21) - Fix `pythinker doctor` crashing on native installs, and report the last recorded update outcome. - [#49](#49) [`f35061e`](f35061e) - Model permission deny rules now also apply to subagent model overrides coming from agent profiles and from resume or retry, not only to models named in tool arguments; a denied override falls back to the parent agent's model. - [#46](#46) [`bceff21`](bceff21) - Stop reporting an update as installed when the executable did not change; the version is checked after the installer finishes and a mismatch is recorded as a failure with the reason. - [#46](#46) [`bceff21`](bceff21) - Show download progress under the prompt while a Windows update installs, instead of nothing until it finishes. - [#46](#46) [`bceff21`](bceff21) - Fix automatic updates on Windows for npm, pnpm, and yarn installs, which failed to start at all. - [#50](#50) [`38e3504`](38e3504) - Record the origin of the prompt that entered Dynamic Workflow mode, so a fan-out started by a scheduled job or hook is attributable in the session records. - [#49](#49) [`f35061e`](f35061e) - Subagent lifecycle events now carry the workflow name on start, completion and failure, and suspension events carry both the workflow run id and name, so clients can correlate every event without caching the spawn event. ## pythinker-code@0.9.0 ### Minor Changes - [#48](#48) [`17967df`](17967df) - Combine permission mode, plan mode, and thinking effort into one composer menu, and answer approval prompts with number keys. - [#48](#48) [`17967df`](17967df) - Add a config hub page that shows models, providers, MCP servers, the local config file, and extension settings in one place. - [#48](#48) [`17967df`](17967df) - The extension UI now follows the editor color theme, including light, dark, and high-contrast themes. - [#48](#48) [`17967df`](17967df) - Add a status bar indicator, quick-fix code actions, terminal and editor context menu entries, a getting-started walkthrough, and a new-conversation keybinding. ### Patch Changes - [#48](#48) [`17967df`](17967df) - Render long conversations with a virtualized list, fix control overlap at narrow sidebar widths, and make sign-out work from the command palette. - Updated dependencies [[`c8cdcc7`](c8cdcc7)]: - @pythoughts/pythinker-code-sdk@0.15.0 ## @pythoughts/pythinker-code-sdk@0.15.0 ### Minor Changes - [#51](#51) [`c8cdcc7`](c8cdcc7) - The saved-workflow write helper now takes the working directory and resolves the repository root itself, saved workflows can carry a size guideline, and the workflow size guideline resolver is exported. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.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.
Related Issue
No linked issue — the problem is explained below.
Problem
The
dynamic_workflow_mode.entersession record named the trigger (toolor RPC) but not who drove it. A fan-out started by a scheduled job or a hook was indistinguishable from one started by the user, so after-the-fact attribution of workflow activity in session records was impossible.What changed
TurnFlowkeeps thePromptOriginof the prompt that launched the active turn and exposes it asactiveTurnOrigin(undefined between turns and while resuming).DynamicWorkflowMode.enterrecords that origin on thedynamic_workflow_mode.enterrecord. Thetooltrigger always fires inside a turn, so the origin names what drove the fan-out (user, cron, hook); the explicit RPC toggles run between turns and record no origin.The field is optional on the record type, so existing readers are unaffected.
Tests: the turn suite now asserts the enter record carries the origin.
Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update. (Session-record internals; no user-facing docs affected.)