oceanbase / oceanbase/powercontext

Tracking Issue: lifecycle-aware Agent integrations

Open
#1,362 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
1.1k
Forks
212
Avg merge
1d 11h
Merged PRs (30d)
199

Description

Goal

Track how PowerContext uses Agent lifecycle events for context delivery, Source capture, and bounded continuation.

Codex is the first delivery target because it has documented lifecycle events that we can test against the current PowerContext integration. The first implementation should settle the PowerContext behavior for scope resolution, context preparation, Source capture, budgets, diagnostics, and failure handling.

Other Agent integrations may reuse that behavior and its contract tests when their public lifecycle events provide equivalent timing and data. They do not need to expose the same hook names or payloads.

Related work: #1213, #1338, #1352, and #1357.

Current baseline

The Codex integration currently uses UserPromptSubmit to prepare bounded context and independently capture the user prompt. Runtime selection, rendering, citations, and persistence remain owned by the PowerContext Server.

Other lifecycle events may provide useful boundaries, but they do not all provide the same input. For example, session bootstrap has no user query, subagent events may not contain a stable task description, and compaction hooks do not provide a stable transcript contract. Each capability must be validated before it is listed as supported.

Closed issues #1040 through #1045 describe an earlier PowerMem and Claude Code implementation. They do not represent the current PowerContext Codex integration or its public contracts.

Tracking

Codex first implementation
  • Define session bootstrap for supported SessionStart sources, including startup, resume, clear, and compact.
  • Decide how session bootstrap prepares context when no user query exists. Record any public request or profile change in an RFC before changing the API.
  • Determine whether SubagentStart provides enough stable task input for isolated, scope-safe recall. Implement subagent context only when the input is sufficient.
  • Select and test one allowlisted PreToolUse or PostToolUse context use case before adding tool lifecycle support.
  • Define deterministic, bounded continuation conditions for Stop and SubagentStop. Do not treat either event as proof that a task succeeded or completed.
  • Preserve only PowerContext-owned continuity state around compaction. Restore bounded context through SessionStart with source=compact without depending on private or unstable transcript formats.
  • Add focused contract tests, content-free diagnostics, and maintained documentation for every delivered capability.
Reuse across Agent integrations
  • Identify the host-neutral behavior and contract tests from the Codex implementation.
  • Select another Agent only after Codex behavior is stable and the Agent exposes suitable public lifecycle events.
  • Track each additional Agent in its own implementation issue.
  • Share contract fixtures or helpers where they reduce drift without coupling installation packages.
  • Record verified per-host capabilities through #1357.

Completion criteria

  • Every Codex lifecycle capability is marked as delivered, unsupported, or deferred with test evidence or an upstream constraint.
  • Existing UserPromptSubmit recall and prompt capture remain unchanged unless a reviewed child issue explicitly replaces part of that behavior.
  • Lifecycle hooks do not duplicate context preparation or inject the same prepared content twice for one model request.
  • Each delivered path defines its scope, context budget, and failure behavior.
  • Recall, capture, and checkpoint failures do not block normal Agent work.
  • Integrations do not read private databases or depend on unstable transcript formats.
  • Another Agent is listed as supported only after its integration behavior is tested against its public lifecycle contract.

Constraints

  • Do not define a universal cross-Agent hook API.
  • Do not perform general retrieval or Source capture for every tool call.
  • Do not use Stop, SubagentStop, SessionEnd, or idle events as task-completion signals.
  • Do not move Runtime selection, citation, rendering, or persistence policy into Agent adapters.
  • Do not add a shared integration runtime before a second maintained integration proves that the abstraction is useful.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the current Codex UserPromptSubmit integration and review related issues #1213, #1338, #1352, and #1357 alongside the public lifecycle events. Done means each Codex capability is delivered, unsupported, or deferred with test evidence or an upstream constraint, without changing existing recall and prompt capture behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
ai, backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.