Commit 6c8639b
fix notepad-window via cmd.exe /c start + native-pattern research doc
Two things in one commit:
1. URGENT FIX: notepad-no-window (operator-flagged 2026-05-18 "FAIL!!
NO NOTEPAD"). Broker dispatched via Start-Process inside
PowerShell, source data confirmed the launch returned success +
"launched via Start-Process" -- but no window appeared.
Root cause: mios-launcher.service runs under user@992.service
(systemd USER MANAGER session c2 "manager-early"), NOT the
operator's interactive desktop session c11 (CLASS=user). When
PowerShell.exe is exec'd via WSL interop from c2, Start-Process
inherits the user-manager session context -- the spawned process
has no window station/desktop, MainWindowHandle stays 0. My
prior fix (replacing setsid+nohup with Start-Process) addressed
only HALF the problem.
The bulletproof Win32-from-WSL pattern is `cmd.exe /c start ""`:
`start` uses ShellExecute, which goes through HKEY_CURRENT_USER
associations + uses the operator's interactive shell's window
station regardless of the launching session. cmd.exe runs via
the WSL interop bridge and attaches to session 1 -- the new
process surfaces on the operator's desktop.
PowerShell stays in the picture for the post-launch placement
step (MoveWindow/SetForegroundWindow against an EXISTING hwnd is
pure Win32 API, not a process spawn, so session-context doesn't
apply). The placement step now finds the new window by process
basename (Get-Process -Name <basename> | Where MainWindowHandle
-ne 0 | Sort StartTime -Descending | Select -First 1) instead
of tracking the Start-Process PID return.
Live verification: echo "CAPTURE: mios-windows launch notepad"
| nc -U socket -> output "[mios-windows] launched via cmd /c
start: C:\Windows\System32\notepad.exe". Get-Process notepad
shows Id 23128 SessionId 1 MainWindowHandle 31262892 title
"Untitled - Notepad" -- handle != 0, window VISIBLE on
operator desktop.
2. RESEARCH DOC: /usr/share/mios/docs/native-os-agent-patterns.md
(operator-flagged "what's native to the Whole technology stack
GLOBALLY ... Research!!!"). Three-layer composition that's
actually 2026 industry standard:
Layer 1 -- OpenAI strict function-calling with JSONSchema enums
* launch_app(name, args?, position?, monitor?) where position
is an enum: center / left / right / top / bottom / top-left /
... / maximize / as-is
* Schema enforces valid values -> no SOUL.md ban-lists, no
regex post-checks, the model NATIVELY picks the right enum
for "launch on the top right".
* Counterpart typed verbs: focus_window, move_window,
close_window, list_windows, screen_layout, open_url,
open_map, show_image, take_screenshot, launch_app_in.
Layer 2 -- MCP (Model Context Protocol) server
* Open JSON-RPC standard Anthropic introduced Nov 2024,
Anthropic + OpenAI + Google DeepMind all support, 500+
public servers, 97M monthly SDK downloads.
* mios-mcp-server wraps the typed toolset above. Same MCP
server works for OWUI (via mcpo bridge), Claude Desktop,
Cursor, any future MCP-aware client -- no per-integration
code.
Layer 3 -- Anthropic Computer Use fallback
* For UIs without a clean API: agent gets screenshot /
mouse_click / keyboard_type / scroll, reasons visually,
acts. Used ONLY when typed tool doesn't cover the intent.
Migration plan in the doc: 4 phases (extend mios_verbs, ship
MCP server, drop regex tower, add Computer Use fallback).
Doc auto-registered into the "MiOS Documentation" knowledge
collection at deploy time (now 34 files; managed_by=
mios-knowledge-add so cache-clear preserves it). Attached to
the mios-agent model row's meta.knowledge -- the agent itself
can now RAG over the architecture spec on future turns.
Sources cited in the doc: OpenAI Function Calling guide, OpenAI
Structured Outputs, MCP spec + 2026 roadmap, Anthropic Computer
Use docs + comparison vs OpenAI CUA.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 8b6de56 commit 6c8639b
2 files changed
Lines changed: 340 additions & 44 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
479 | 479 | | |
480 | 480 | | |
481 | 481 | | |
482 | | - | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
491 | | - | |
492 | | - | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
493 | 503 | | |
494 | 504 | | |
495 | | - | |
496 | | - | |
| 505 | + | |
| 506 | + | |
497 | 507 | | |
498 | 508 | | |
499 | 509 | | |
500 | | - | |
501 | | - | |
502 | | - | |
503 | | - | |
504 | | - | |
505 | | - | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
506 | 515 | | |
507 | 516 | | |
508 | 517 | | |
| |||
559 | 568 | | |
560 | 569 | | |
561 | 570 | | |
562 | | - | |
563 | | - | |
564 | | - | |
565 | | - | |
566 | | - | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | | - | |
571 | | - | |
572 | | - | |
573 | | - | |
574 | | - | |
575 | | - | |
576 | | - | |
577 | | - | |
578 | | - | |
579 | | - | |
580 | | - | |
581 | | - | |
582 | | - | |
583 | | - | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
584 | 575 | | |
585 | | - | |
586 | | - | |
| 576 | + | |
587 | 577 | | |
588 | 578 | | |
589 | 579 | | |
590 | | - | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
591 | 621 | | |
592 | 622 | | |
593 | 623 | | |
| |||
0 commit comments