Skip to content

Commit d72066a

Browse files
authored
fix: harden workflows, configuration, and desktop UX (#246)
## Related Issue N/A — maintainer-directed hardening batch. ## Problem Several agent, configuration, desktop, and Web paths still had reliability or presentation gaps. Dynamic Workflow could lose truthful progress or recovery details after partial failures and used different subagent-selection paths across entry points. Configuration saves could expose transient reads, desktop launches could use the wrong executable order, and installer and tool-row presentation remained inconsistent. ## What changed - Route Dynamic Workflow, Tower, and Session Init through the shared subagent spawn planner; validate routing inputs and preserve created-child recovery details. - Keep configured workflow capacity authoritative during rate limits, frame child results safely, and recover truthful row counts and statuses from partial events. - Keep built-in prompts free of clock-derived text while preserving `${now}` for custom templates; stabilize configuration reads and validate Dynamic Workflow environment overrides. - Use login-shell executable order for desktop-launched tools and brand the macOS DMG with a drag-to-Applications layout. - Align Web tool icons and completion indicators, preserve distinct workflow result rows, and rebuild the committed Web bundle. ### Review focus - Shared subagent selection, forced-policy precedence, fork validation, cancellation rollback, and binding preservation. - Rate-limit recovery, startup failures, active-versus-queued attribution, and partial-result rendering. - Desktop PATH ordering, DMG packaging, configuration-save stability, and generated Web asset provenance. ### Verification - `pnpm test` — 1,231 files and 20,843 tests passed; 12 files and 79 tests skipped; 3 expected failures and 2 todos. - Final `agent-core-v2` suite — 350 files and 5,855 tests passed. - Pre-push changed suite — 418 files and 7,147 tests passed; 2 files and 2 tests skipped; 1 todo. - `pnpm build`, `pnpm typecheck`, and `pnpm lint` passed; lint reports 0 errors and 3,329 existing warnings. - Docs build, Web asset freshness, Sherif, flake workspace sync, changeset validation, and diff checks passed. ## Checklist - [x] I have read the [CONTRIBUTING](https://github.com/PyModel/pythinker-code/blob/main/CONTRIBUTING.md) document. - [x] Related issue: N/A — maintainer-directed hardening batch. - [x] I have added tests that prove the changes work. - [x] Ran `gen-changesets`; the existing CLI and desktop patch changesets cover user-visible changes, with no new breaking change. - [x] Ran `gen-docs`; custom-template compatibility and Dynamic Workflow controls are documented, and the docs build passed. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added dynamic workflow concurrency controls through configuration and environment settings. * Improved subagent spawning, cancellation, recovery, and progress tracking. * Desktop tools now use the login shell’s executable path order. * **Bug Fixes** * Fixed tool-call icons and completion indicators appearing misaligned. * Preserved models and providers while configuration files are being saved. * Improved recovery of partially completed workflow results. * Added safer handling for encoded workflow output and file updates. * **Style** * Updated macOS installer branding and layout. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent df238bd commit d72066a

160 files changed

Lines changed: 2000 additions & 965 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/align-tool-row-icons.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@pymodel/pythinker-code": patch
3+
---
4+
5+
Align tool-call icons and completion indicators with their labels in web conversations.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@pymodel/pythinker-desktop": patch
3+
---
4+
5+
Brand the macOS installer with the Pythinker Code drag-to-Applications layout.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@pymodel/pythinker-code": patch
3+
---
4+
5+
Fix Dynamic Workflow subagent selection, recovery, and progress reporting during partial failures.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@pymodel/pythinker-code": patch
3+
---
4+
5+
Fix models and providers briefly disappearing when an external editor saves the configuration.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@pymodel/pythinker-code": patch
3+
---
4+
5+
Use the login shell's executable order for tools started by the desktop app.

apps/desktop/build/background.png

254 KB
Loading

apps/desktop/package.json

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
]
7171
},
7272
"dmg": {
73+
"background": "build/background.png",
7374
"sign": true,
7475
"title": "Pythinker ${version}",
7576
"window": {
@@ -80,14 +81,28 @@
8081
"contents": [
8182
{
8283
"x": 180,
83-
"y": 200,
84+
"y": 250,
8485
"type": "file"
8586
},
8687
{
8788
"x": 480,
88-
"y": 200,
89+
"y": 250,
8990
"type": "link",
9091
"path": "/Applications"
92+
},
93+
{
94+
"name": ".background.png",
95+
"path": "build/background.png",
96+
"type": "file",
97+
"x": 760,
98+
"y": 520
99+
},
100+
{
101+
"name": ".VolumeIcon.icns",
102+
"path": "dist/.icon-icns/icon.icns",
103+
"type": "file",
104+
"x": 760,
105+
"y": 520
91106
}
92107
]
93108
},

apps/desktop/tests/packaging-config.spec.ts

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ interface DesktopPackage {
99
readonly afterPack: string
1010
readonly appId: string
1111
readonly dmg: {
12+
readonly background: string
1213
readonly contents: readonly {
14+
readonly name?: string
1315
readonly path?: string
1416
readonly type: string
1517
readonly x: number
@@ -135,11 +137,39 @@ describe('desktop packaging configuration', () => {
135137
window: { height: 400, width: 660 },
136138
})
137139
expect(desktopPackage.build.dmg.contents).toEqual([
138-
{ x: 180, y: 200, type: 'file' },
139-
{ x: 480, y: 200, type: 'link', path: '/Applications' },
140+
{ x: 180, y: 250, type: 'file' },
141+
{ x: 480, y: 250, type: 'link', path: '/Applications' },
142+
{
143+
name: '.background.png',
144+
path: 'build/background.png',
145+
type: 'file',
146+
x: 760,
147+
y: 520,
148+
},
149+
{
150+
name: '.VolumeIcon.icns',
151+
path: 'dist/.icon-icns/icon.icns',
152+
type: 'file',
153+
x: 760,
154+
y: 520,
155+
},
140156
])
141157
})
142158

159+
it('uses the branded 660x400 macOS DMG background', () => {
160+
const backgroundPath = resolve(desktopRoot, 'build/background.png')
161+
162+
expect(desktopPackage.build.dmg.background).toBe('build/background.png')
163+
expect(existsSync(backgroundPath)).toBe(true)
164+
165+
const background = readFileSync(backgroundPath)
166+
expect(createHash('sha256').update(background).digest('hex'))
167+
.toBe('95e8b785add86919d269b198844d8a903280190f8fd33d5f8ffdca404c113fa8')
168+
expect(background.subarray(0, 8).toString('hex')).toBe('89504e470d0a1a0a')
169+
expect(background.readUInt32BE(16)).toBe(660)
170+
expect(background.readUInt32BE(20)).toBe(400)
171+
})
172+
143173
it('configures the Windows x64 NSIS installer', () => {
144174
expect(desktopPackage.build.win.target).toEqual([{ target: 'nsis', arch: ['x64'] }])
145175
expect(desktopPackage.build.nsis).toEqual({
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"sourceHash": "0cff6a0f19b48a2c0372aee63de7a176f5d499a92f2e6d297c5e456376f63283",
2+
"sourceHash": "5e490fdbfda9e6666965a6c99496a2fc8f5e34ed8df8ab61ec9342ea5f19932c",
33
"sourceFileCount": 411
44
}

apps/pythinker-code/dist-web/assets/CodeBlockNode-DhHNvLD-.js renamed to apps/pythinker-code/dist-web/assets/CodeBlockNode-DcsL9UWH.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)