Sync coding agent context

This commit is contained in:
vczh
2026-08-03 19:00:09 -07:00
parent 5cb97f351e
commit 8691aa0e5d
5 changed files with 47 additions and 18 deletions
+18 -1
View File
@@ -16,13 +16,23 @@ In general, here is my preference for any languages:
## Be Brave Enough to Fix Upstream Code and Make Breaking Change
This section is a high level philosophy of trade-offs during making decision of where to fix the code.
It looks amgibuous, that actually means you are expected to consider the context of each issues you are facing to.
- Always fix the bug at its root cause.
- If you find any API that doesn't work, fix instead of making a replacement. Even when the API is in an upstream repo, prefer fixing in the upstream repo and releasing it to the current repo.
- DO NOT concern about making breaking change.
- The project is well covered by unit test, any unexpecting breaking change is highly possibly to be cought.
- If such breaking change is intented, unit test could help you perform complete refactoring.
- If an API design does not fit the requirement or contract, just change it.
- Interface design could have been wrong, DO NOT implement twisted logic just to finish the current task while fitting the wrong design.
- Interface design could have been wrong, DO NOT implement twisted logic just to finish the current task while fitting the wrong design.
- But DO NOT leaks information from downstream to upstream repos.
- Each upstream repo has its own scope, contract, policy, strategy, etc.
- Each upstream repo releases libraries that is supposed to serve broader purposes.
- Keep interfaces between repos clean.
- If downstream repos need to need to do something depending on upstream repos' non-public information:
- If the issue is the upstream repo itself, fix the upstream repo.
- Otherwise, expose informations elegantly so that downstream repos could process and react to them properly.
## C++ Thread Safety and Multi-Threading Synchronization
@@ -30,6 +40,13 @@ Check out [Coding_MultiThreading.md](./Coding_MultiThreading.md).
## C++ Coding Convention
- Anonymouse namespace `namespace{}` is not welcomed:
- DO NOT generate such construction.
- When you edit any existing code and see this, remove that anonymouse namespace and fix the indentation of the content.
- The reason is that, moust of cpp files will be merged into one single file apon release, all benefits are gone meanwhile the code looks messy.
- Impl classes like `class Something { class Impl; Ptr<Impl> impl; }` is not always welcomed:
- Hiding information or improve building performance with this pattern is considered incorrect here.
- The only exception is forcing to hide platform dependend constructions, like `vl::Mutex`.
- Although C++ does not require this but we want to have `extern` on all function forward declarations.
- In general we don't use `inline` in header files unless such function is performance critical, e.g. very simple comparison operators.
- Rules for C++ header files:
+15 -5
View File
@@ -11,14 +11,12 @@ When the model `gpt-5.3-codex-spark` is available:
- If the target application has bugs, it is normal that steps can't be performed to the end. The sub agent should summarize what is going wrong to prevent steps to be done.
- This model is fast, it significantly improves the performance of operating the GUI.
## Windows Specific
- GacUI applications could end up in dead loop or dead locks, so DO NOT JUST wait for the process to exit.
- When it is crashed, sometimes (but not always) a native dialog would show and block the process.
- Native dialogs could be proactivately called from a GacUI application, even when `FakeDialogService` is not used.
- If you believe the processing is blocked or is running too long, you are going to check out `Running-ComputerUse.md` and deal with it.
### Automation Service via HTTP
## Automation Service via HTTP
This is a very useful way for coding agent to debug GacUI applications.
Computer use via UI Automation may not work when the computer screen is locked.
@@ -36,6 +34,7 @@ When `StartWindowsHttpAutomationService` is used during startup up a GacUI appli
- GET `.../Dom`, for remote protocol renderer, exposing the DOM tree.
- Read comment for DumpRemoteProtocolRenderingDom` for the schema.
- POST `.../IO` or `IO/<WINDOW-ID>`
- Set `Content-Type` to exactly `application/json; charset=utf8`. The Windows HTTP implementation validates this value before reading the UTF-8 command body.
- IRead comment for `RunIOCommandOnNativeWindow` for the schema.
- `<WINDOW-ID>` is the window id returning from `.../Controls`.
- The window ID can be comitted for the main window.
@@ -58,10 +57,21 @@ GacUI does not support UI Automation so far, but this situation will be changed
UI Automation does not work when the screen is locked. Calling any UIA tools in this case will just fail.
## Windows Specific
- While polling automation endpoints or waiting for application processes, repeatedly inspect the target processes for a top-level window titled exactly `Microsoft Visual C++ Runtime Library`.
- Treat this window as a blocking crash signal immediately. Do not keep retrying the application-level endpoint, because the modal dialog can block the UI thread and make a crash look like an ordinary timeout.
- Capture the dialog text and buttons with the Win32 procedure in `Running-ComputerUse.md`, dismiss it deliberately, and record the process exit code.
- Check again after every automation timeout and before declaring a run successful.
## Linux Specific
(to be editing...)
When maintaining the `vczh-libraries` github organization:
- Only `wGac` repo runs actual GacUI application on Linux.
- `GacUI` test apps only work when they are unit test, CLI or GacUI remote protocol core application (which is also CLI but with automation service enabled).
## macOS Specific
(to be editing...)
When maintaining the `vczh-libraries` github organization:
- Only `iGac` repo runs actual GacUI application on macOS.
- `GacUI` test apps only work when they are unit test, CLI or GacUI remote protocol core application (which is also CLI but with automation service enabled).