Skip to content

feat(integrations): align agent guidance and tool routing - #1522

Open
knqiufan wants to merge 5 commits into
oceanbase:masterfrom
knqiufan:codex/align-powercontext-tool-routing
Open

feat(integrations): align agent guidance and tool routing#1522
knqiufan wants to merge 5 commits into
oceanbase:masterfrom
knqiufan:codex/align-powercontext-tool-routing

Conversation

@knqiufan

@knqiufan knqiufan commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Which issue or RFC does this PR close?

Closes #1520. Implements D of #1450 without closing the parent tracker.

Rationale for this change

Agents select exposed tools before loading a Skill. Inconsistent guidance can turn historical lookup into inventory, Source capture into a false Memory-save acknowledgement, or an ordinary handoff into an unintended durable commit. The system guidance, tool descriptions, and existing Skills must agree on intent, evidence, and authorization.

What changes are included in this PR?

  • Align guidance for DSH, OpenCode, Pi, OpenClaw, Hermes, MCP-backed Codex/Claude Code/WorkBuddy, and the portable Agent Plugin Skill. Preserve existing Skill names and host capabilities.
  • Separate search from inventory, explicit Memory writes from Source capture, previews from writes, temporary Handoffs from durable commits, and candidate inspection from approval or execution. Ordinary handoff imperatives return a temporary carrier; commit requires an explicit durable-milestone request.
  • Specify current-work WorkClaim arguments and distinguish declared inspected facts from exact existing PowerContext evidence. Use the actual Source response field and preserve exact returned Drafts and carriers.
  • Inject Pi guidance even when recall is empty or fails; derive OpenClaw guidance from its available tools; add MCP initialize instructions and regenerate descriptions from OpenAPI. No runtime approval mechanism is bypassed.
  • Evaluate Handoffs through subsequent calls and controlled results. Reject empty/malformed arguments, invented references, changed Scopes or Drafts, premature completion, and later commits; require the complete unchanged prepared carrier. Add regression tests for the previously false passes.
  • Preserve launchd state and retry evidence before native-test cleanup; add a regression proving startup-failure diagnostics survive removal of the original files. Startup deadlines and native acceptance assertions are unchanged.
  • Integrate current master, preserving Scope discovery semantics and Hermes context-assembly coverage. Rebuild checked-in plugin bundles. Add OpenCode/OpenClaw CI jobs and fix capability scanning to respect tool-registration boundaries.

Are there any user-facing changes?

Agents receive consistent guidance before and after Skill loading. A plain handoff request no longer implicitly requests a durable milestone in the Codex, Claude Code, or WorkBuddy Skill. Existing explicit durable requests remain supported without redundant confirmation. Tool names, HTTP fields, persisted formats, Scope boundaries, and host approval behavior are unchanged.

#1494 is already merged into master. D has independent scope; layered Skills remain E, and canonical naming/distribution remain owned by #1405 / #1410.

The bilingual evaluation record separates first-turn selection from multi-turn qualification. The 48/48 first-turn sample is not evidence of completed Handoff execution. The latest multi-turn observations total 64/96 across eight surfaces; incomplete carriers, invalid provenance, and unfinished native workflows remain unqualified, with every failure retained in the evidence. No commit call occurred in those observations, but early failures truncate their sequences. Model errors and missing-tool stress failures remain recorded; catalog evaluation with controlled results does not certify automatic Skill discovery or native execution in every host.

How was this change tested?

  • 213 focused Python tests passed across API/JS contracts, MCP, Hermes, capability manifest, guidance evaluation, Codex plugin contracts, Prompt publication, and real HTTP/MCP Handoff behavior.
  • DSH: 178 unit tests, 9 HTTP tests, and 4 real SDK/host runtime tests passed. OpenCode: 26 tests and typecheck/build passed. Pi: 51 tests, including its real CLI, and typecheck passed. OpenClaw: 32 tests and typecheck/build passed with Node 24.15.0.
  • OpenAPI and JS generation checks passed. Structural comparison with master confirms only operation descriptions differ in the API contract.
  • Lock verification and all applicable pre-commit hooks passed; Linux-platform type checking passed for src scripts tests integrations. The local whole-workspace ty-check hook is excluded because it includes unrelated untracked personal documents and existing Windows-specific errors; CI runs the unmodified full quality checks.
  • Live bilingual multi-turn Handoff results and configuration are linked in the evaluation record. Each passing run includes validated arguments, controlled operation results, and the exact final carrier; remaining model deviations are explicitly retained.
  • All 18 checks other than macOS passed on 6237b2a9, including Python 3.11–3.14, SQLite/OceanBase acceptance, website, quality, all package checks, Linux, and Windows. The macOS native lifecycle job timed out waiting for the installed service, with empty output/error logs; the same runtime code passed in the preceding run. Cleanup erased the launchd registration and retry evidence before workflow diagnostics could inspect them. The diagnostic regression test passes locally, and the macOS native acceptance on e3f41765 passed with the original startup deadline and assertions. The intermittent startup timeout did not reproduce; its root cause remains unconfirmed. Future failures retain launchd state and retry evidence before cleanup.
  • The recorded real Codex Memory save/search/unavailable-MCP acceptance and live DSH approval-denial/search evidence remain documented with their original tested versions.

AI usage statement

OpenAI Codex (GPT-6 Astra) assisted with implementation, review, documentation, and tests. Step 3.7 Flash was used for recorded live-model routing evaluations. Native execution and controlled-catalog measurements are reported separately.

@knqiufan
knqiufan force-pushed the codex/align-powercontext-tool-routing branch from 1b114f5 to 5fb191f Compare September 9, 2026 03:28
@knqiufan
knqiufan force-pushed the codex/align-powercontext-tool-routing branch from 5fb191f to 98629ea Compare September 9, 2026 03:39
@knqiufan
knqiufan marked this pull request as ready for review September 10, 2026 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(integrations): align PowerContext system guidance and tool routing

1 participant