Repository navigation
feat(pawapp): redesign the SDK and app control plane - #7874
Open
cyruszhang wants to merge 107 commits into
Open
cyruszhang wants to merge 107 commits into
cyruszhang wants to merge 107 commits into
Conversation
TC-DATA-04: SQL datasource credentials are registered through the context service's datasource API (embedded console Data Sources page), not via .env or a Configure section. Update the config.py docstring and README Configure section to state the actual contract.
Replace the host agent-loop chat with the QwenPaw-Data engine: a managed engine sidecar (uvicorn host-core service) wired to the context service and model config, an authenticated /engine proxy with SSE pass-through, and a ChatWorkspace that creates engine sessions/chats, streams the turn from the event API, restores history by replaying persisted events, and resumes still-running turns. Adds mid-run steering from the composer, clarification (ask_user_question) cards answered back into the runtime, follow-up suggestion chips, and a stop control.
Bring the transcript up to the console workbench: an analysis-plan panel from task_status graph snapshots, a BizTrace milestone timeline with durations and span markup stripped to plain text, and an artifact strip that downloads real files through the new engine artifacts route. All three restore on history replay since they reduce from the same persisted event stream.
…ne .mcp Two defects found by the first live browser run of the engine-native chat: - paw.api.events defaults to POST, but the engine's chat events route only accepts GET, so every stream subscription died with 405 and the chat reported "PawApp API error 405". Pass method: "GET" explicitly. - The managed engine sidecar started with an empty workspace .mcp, so sandboxed agents had no DataBridge tools and correctly refused to run any analysis. The CLI provisions this file via "qwenpaw-data mcp import", but nothing did so for the managed engine. provision_engine_mcp() now upserts the databridge entry (CM URL + bearer token) on every engine start while preserving user-added entries and recovering from corrupt files.
Track-A step 3, built native against the OSS engine API with the Cloud console UX as reference: - SettlementPanel surfaces pending knowledge cards under the transcript (poll follows the engine's pending->queried contract, refreshes when a turn completes); confirm triggers the CM write-back, dismiss archives. Card titles and field ordering mirror the Cloud console. - New Automations page lists console cron jobs with create/pause/resume/ run-now/delete; jobs deliver to the engine session runtime. IM-channel targeting stays out of scope until channel binding lands in the app. - engineApi grows typed settlement + cron wrappers; 6 new tests.
…hinking card
Phase 1 of console-parity for the engine-native chat:
- Segments render as rich cards (title + duration, Input/Execution/
Conclusion markdown blocks with highlighted conclusion, and key-artifact
rows with descriptions) instead of a thin collapsible timeline. The
engine's biztrace frames already carry the full structure.
- Artifacts (message strip and per-segment) become card rows with preview
and download actions; an in-app modal previews HTML reports in a
sandboxed iframe, images inline, and csv/md/json as text.
- Fix a latent step-2 bug found live: downloadArtifact embedded the query
string in the request path, which the host SDK's scoped-path validation
rejects ("Invalid PawApp scoped path"), so every artifact download
silently failed in the browser; the path now goes through options.query.
- The streaming analysis trace collapses into a thinking card: closed by
default with a one-line ticker of the latest narration, markdown-rendered
when expanded, so raw model narration no longer dominates the transcript.
Replace the plugin-native chat, cron, and settlement views with the real engine console, vendored as a hash-routed static SPA by the new scripts/sync-console-ui.sh (same pattern as the Context console embed). The build is patched via a checked-in git patch — hash routing, /api/v1 gateway paths, SSO shimmed out, MCP settings dropped, and Skills Hub routed to an open-source contribution page — with an internal-marker scan gating the vendored output. The Analyze and Automations tabs now drive one iframe (console home and cron-jobs routes); ChatWorkspace, CronJobs, SettlementPanel, and the orphaned GraphExplorer/SemanticCatalog components are removed along with their tests.
The embedded console ships its own navigation (sessions, Skill Hub, scheduled results, settings), so wrapping it in the plugin's Analyze/Manage rail duplicated every affordance. The shell is now a slim topbar hosting only what the console does not own — runtime health, the DataBridge management console, and plugin configuration — each toggling over the full-bleed console.
…t console The console sidebar already carries the brand, so the topbar keeps only the action cluster (status chip, configuration, language). The Manage iframe goes away: the console's own DataBridge entry and the health page's "Manage sources" now open the Context console in a full tab, which beats a second baked-in iframe. The health page loses the summary card that duplicated the runtime-status cards below it.
…ation The QwenPaw host authenticates the app, so the console's User Center / Change Password / Sign Out menu is dead weight in the embed. The patch now gates the account dropdown on a resolved host user, which the disabled-auth bootstrap never provides.
Model setup now lives in the console's Agent Configuration page (the engine serves its runtime-settings routes), and the console's language toggle covers i18n, so the plugin topbar had nothing left to host. The settings menu gains an App Configuration entry that asks the parent frame (postMessage) to open the remaining native page — context service infrastructure — as a closeable overlay. The diagnostics page and its status model are removed; the console surfaces engine failures itself.
The overlay page broke the console's design language and its model card read as a duplicate of Agent Configuration. The settings menu now opens a console-native DataBridge Configuration page (ConsoleRouteHeader + antd cards, same flow as Agent/Channel Configuration) scoped to what Agent Configuration does not cover: the semantic service's own model, the embedding model, and the Neo4j graph store — with an explicit pointer that the analysis agent's model lives in Agent Configuration. The page talks to the hosting app's backend, which gains a restart-context endpoint replacing the host-SDK dependency action. The native shell collapses to a bootstrap that mounts the console iframe; Configure, the string tables, icons, and the API client are gone (styles.css 2983 → 125 lines).
Route IM conversations through QwenPaw's own channel infrastructure instead of the engine's channel connectors: a session-gated on_reply middleware (/data on|off) forwards turns to the engine's SSE API and re-emits frames as AgentScope events, so streaming text/reasoning, image artifacts, clarification round-trips (numbered-text answer + resume via after_sequence_number), followups, and /stop work on any configured channel. Adds /datasource selection, a per-session bridge store, and denies the engine's channel-management routes through the gateway; the vendored console drops its Channel Configuration page. SDK: implement ctx.notify via workspace.channel_manager, add app.middleware() passthrough, and wire the previously-dead @app.command buffer to register_slash_command.
The staging step copied only top-level backend/*.py, so hot-installs were missing the channel-bridge subpackage and the plugin failed to load.
The engine's stop route awaits the full ChatRuntime cancellation, which can exceed the client's default 30s read timeout mid-sandbox step; the best-effort stop then failed with ReadTimeout and left the engine chat running.
feat(qwenpaw-data): ship the engine console as the app surface
Use the QPD 0.3 Neo4j settings and allow the Compose service hostname so seeding and graph access work from containers.
feat(qwenpaw-data): adopt the QPD 0.3 runtime
Replace backtracking-prone route and datasource regex handling with deterministic validation to address CodeQL findings without changing supported flows.
Use the canonical allowlisted path at the outbound request boundary so encoded client input cannot bypass gateway validation.
cyruszhang
requested a deployment
to
ai-review-approved
October 22, 2026 15:58 — with
GitHub Actions
Waiting
cyruszhang
requested a deployment
to
maintainer-approved
October 22, 2026 15:58 — with
GitHub Actions
Waiting
cyruszhang
requested a deployment
to
ai-review-approved
October 22, 2026 17:12 — with
GitHub Actions
Waiting
cyruszhang
requested a deployment
to
maintainer-approved
October 22, 2026 17:12 — with
GitHub Actions
Waiting
cyruszhang
requested a deployment
to
ai-review-approved
October 22, 2026 17:20 — with
GitHub Actions
Waiting
cyruszhang
requested a deployment
to
maintainer-approved
October 22, 2026 17:20 — with
GitHub Actions
Waiting
cyruszhang
requested a deployment
to
ai-review-approved
October 23, 2026 19:23 — with
GitHub Actions
Waiting
cyruszhang
requested a deployment
to
ai-review-approved
October 26, 2026 16:24 — with
GitHub Actions
Waiting
cyruszhang
requested a deployment
to
maintainer-approved
October 26, 2026 16:26 — with
GitHub Actions
Waiting
cyruszhang
requested a deployment
to
ai-review-approved
October 26, 2026 19:02 — with
GitHub Actions
Waiting
cyruszhang
requested a deployment
to
maintainer-approved
October 26, 2026 19:02 — with
GitHub Actions
Waiting
cyruszhang
requested a deployment
to
ai-review-approved
October 27, 2026 15:41 — with
GitHub Actions
Waiting
cyruszhang
requested a deployment
to
maintainer-approved
October 27, 2026 15:43 — with
GitHub Actions
Waiting
cyruszhang
requested a deployment
to
ai-review-approved
October 27, 2026 17:03 — with
GitHub Actions
Waiting
cyruszhang
requested a deployment
to
maintainer-approved
October 27, 2026 17:03 — with
GitHub Actions
Waiting
cyruszhang
requested a deployment
to
ai-review-approved
October 29, 2026 16:34 — with
GitHub Actions
Waiting
cyruszhang
requested a deployment
to
maintainer-approved
October 29, 2026 16:36 — with
GitHub Actions
Waiting
This branch is waiting to be deployed
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.
What Problem This Solves
PawApps can expose durable work to Main Chat and their own UI through a shared, scoped Host contract. Small Apps register an
app.actionhandler; external runtimes implement the adapter protocol. Host owns task identity, retries, permissions, setup, questions, approvals, results, artifacts and continuation delivery.For example, Creator can pause production for generation authorization or content review. Main Chat shows what is being approved and the task's approval progress. Users can authorize clearly scoped generation in chat; content review opens the exact pending review and revision in Creator. Decisions resume the same project/task through Creator's existing mechanisms. A manual review no longer appears as ongoing planning.
This PR includes:
prepare-production;revise-storypreserves revisions;produce-videocontinues the same project with setup/approval gates and verified final-film publication. Generation approvals and content review use shared cards; new content reviews require inspection and decisions inside Creator.App integrations are separate
Both are draft follow-ups to rebase after this SDK merges. Neither App implementation is included here. The shared conformance suite runs without either integration or an external Data Engine.
Compatibility and behavior
Evidence
Local verification for the review follow-up (2026-10-27): 734 backend tests passed, including the PawApp conformance and Creator workflow suites. Regression cases cover revoked-grant cancellation, status redaction, unknown cancellation for missing/changed executors, recovery backoff and restart, App-side approval observation, approval expiry/restart, progress interleaving and artifact hashing. Changed-file pre-commit checks and contract drift checks passed. The isolated deterministic Creator browser acceptance passed with fake providers (image/video approvals, reload, exact handoff and artifact download); no paid calls.
Local verification for the approval contract and Creator adaptation (2026-10-23):
tests/unit/pawapp, Creator's video-workflow suite and project-file review tests. Covers authenticated decisions, cross-scope rejection, expiry/replacement, concurrent decisions, restart/replay, App-side decisions and lost-receipt recovery; also immutable approval content during progress updates, App-only decision enforcement, and stale inspection rejection.git diff --checkand changed-file pre-commit hooks passed.Documentation:
docs/design/pawapp-app-quickstart.md,docs/design/pawapp-approvals.md,docs/design/pawapp-task-runtime.md,docs/design/pawapp-creator-story-handoff.md, anddocs/design/pawapp-contract-progress.md.