Skip to content

feat(web): expose Pi thinking state - #375

Closed
seekskyworld wants to merge 1 commit into
openpi-dev:mainfrom
seekskyworld:feat/issue-348-thinking-state
Closed

feat(web): expose Pi thinking state#375
seekskyworld wants to merge 1 commit into
openpi-dev:mainfrom
seekskyworld:feat/issue-348-thinking-state

Conversation

@seekskyworld

Copy link
Copy Markdown
Contributor

Problem

Adds the reasoning-state inspection slice of #348. The Web workbench could not show the active Pi thinking level or model-supported levels.

Value

Users can inspect reasoning configuration from the browser while Pi remains authoritative.

Approach

Expose optional runtime getThinkingState() backed by Pi AgentSession and an authenticated GET /api/thinking endpoint. Existing controllers remain compatible; no credentials or configuration writes are introduced.

Validation

  • npx tsc --noEmit
  • git diff --check

Impact

  • User-visible behavior: adds bounded reasoning-state inspection.
  • Model-visible context/tools: none.
  • Runtime/lifecycle: read-only Pi state projection.
  • Persisted config/data: none.
  • Compatibility/risk: additive optional seam; setting changes remain future work.

Signed-off-by: seekskyworld <djh1813553759@gmail.com>

@tt-a1i tt-a1i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exact-head standards/spec review found no confirmed P2 or higher issue. The optional runtime seam delegates thinkingLevel and available thinking levels to the real Pi AgentSession API and exposes read-only inspection without changing configuration, tools or model context. Focused existing runtime/host tests passed 39/39; source inspection verified the locked Pi public methods. These existing tests are not dedicated new endpoint coverage or installed UI acceptance. Current PR CI is green, but main integration conflicts in host/types; recommend keeping this narrow capability after resolving conflicts and validating integration. No merge performed.

tt-a1i added a commit that referenced this pull request Sep 7, 2026
…444)

Integrate Session-scoped terminal details from #389, Pi thinking reads from #375, and unarchive from #361 while preserving current trust diagnostics. Add authenticated endpoint and persistent unarchive integration tests.

Co-authored-by: testikun <320479488+testikun@users.noreply.github.com>
Co-authored-by: seekskyworld <djh1813553759@gmail.com>
@tt-a1i

tt-a1i commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

Integrated into main through #444 (1919542). The Pi-owned thinking inspection getter and endpoint were retained with host/type conflict resolution and additional authentication/fallback coverage. Original contributor seekskyworld is credited as a co-author. Full local validation and Node 22/24/26, Web E2E and Windows CI passed. Closing this source PR as integrated; thank you for the contribution.

@tt-a1i tt-a1i closed this Sep 7, 2026
Matt-qwq added a commit to Matt-qwq/openpi that referenced this pull request Sep 10, 2026
Expose Pi's native thinking/reasoning level in the Web workbench: a
runtime setter with a bounded merge-to-latest, a lease-sensitive
POST /api/thinking, a bounded optional thinking projection with a
monotonic revision on the snapshot, a last-intent-wins client store
with a revision gate, and an icon-only composer picker with a disabled
placeholder for unsupported models. Levels come from Pi's
getAvailableThinkingLevels()/supportsThinking(); OpenPI adds no second
reasoning store and no persisted configuration (session-only).

Advances the change-thinking-level criterion of openpi-dev#348 and continues the
read-only GET /api/thinking inspection from openpi-dev#375/openpi-dev#444, preserving its
unknown fallback. Adds browser coverage (22 e2e incl. an axe pass) and a
hermetic provider e2e that proves the selected level reaches the next
provider request as reasoning_effort.

Research records: docs/research/OPENPI_WEB_THINKING_SELECTOR_PLAN_2026-09-11.md
and the linked diagnosis.
Matt-qwq added a commit to Matt-qwq/openpi that referenced this pull request Sep 10, 2026
Expose Pi's native thinking/reasoning level in the Web workbench: a
runtime setter with a bounded merge-to-latest, a lease-sensitive
POST /api/thinking, a bounded optional thinking projection with a
monotonic revision on the snapshot, a last-intent-wins client store
with a revision gate, and an icon-only composer picker with a disabled
placeholder for unsupported models. Levels come from Pi's
getAvailableThinkingLevels()/supportsThinking(); OpenPI adds no second
reasoning store and no persisted configuration (session-only).

Advances the change-thinking-level criterion of openpi-dev#348 and continues the
read-only GET /api/thinking inspection from openpi-dev#375/openpi-dev#444, preserving its
unknown fallback. Adds browser coverage (22 e2e incl. an axe pass) and a
hermetic provider e2e that proves the selected level reaches the next
provider request as reasoning_effort.

Research records: docs/research/OPENPI_WEB_THINKING_SELECTOR_PLAN_2026-09-11.md
and the linked diagnosis.
Matt-qwq added a commit to Matt-qwq/openpi that referenced this pull request Sep 11, 2026
Expose Pi's native thinking/reasoning level in the Web workbench: a
runtime setter with a bounded merge-to-latest, a lease-sensitive
POST /api/thinking, a bounded optional thinking projection with a
monotonic revision on the snapshot, a last-intent-wins client store
with a revision gate, and an icon-only composer picker with a disabled
placeholder for unsupported models. Levels come from Pi's
getAvailableThinkingLevels()/supportsThinking(); OpenPI adds no second
reasoning store and no persisted configuration (session-only).

Advances the change-thinking-level criterion of openpi-dev#348 and continues the
read-only GET /api/thinking inspection from openpi-dev#375/openpi-dev#444, preserving its
unknown fallback. Adds browser coverage (22 e2e incl. an axe pass) and a
hermetic provider e2e that proves the selected level reaches the next
provider request as reasoning_effort.

Research records: docs/research/OPENPI_WEB_THINKING_SELECTOR_PLAN_2026-09-11.md
and the linked diagnosis.
Matt-qwq added a commit to Matt-qwq/openpi that referenced this pull request Sep 11, 2026
Expose Pi's native thinking/reasoning level in the Web workbench: a
runtime setter with a bounded merge-to-latest, a lease-sensitive
POST /api/thinking, a bounded optional thinking projection with a
monotonic revision on the snapshot, a last-intent-wins client store
with a revision gate, and an icon-only composer picker with a disabled
placeholder for unsupported models. Levels come from Pi's
getAvailableThinkingLevels()/supportsThinking(); OpenPI adds no second
reasoning store and no persisted configuration (session-only).

Advances the change-thinking-level criterion of openpi-dev#348 and continues the
read-only GET /api/thinking inspection from openpi-dev#375/openpi-dev#444, preserving its
unknown fallback. Adds browser coverage (22 e2e incl. an axe pass) and a
hermetic provider e2e that proves the selected level reaches the next
provider request as reasoning_effort.
Matt-qwq added a commit to Matt-qwq/openpi that referenced this pull request Sep 11, 2026
Expose Pi's native thinking/reasoning level in the Web workbench: a
runtime setter with a bounded merge-to-latest, a lease-sensitive
POST /api/thinking, a bounded optional thinking projection with a
monotonic revision on the snapshot, a last-intent-wins client store
with a revision gate, and an icon-only composer picker with a disabled
placeholder for unsupported models. Levels come from Pi's
getAvailableThinkingLevels()/supportsThinking(); OpenPI adds no second
reasoning store and no persisted configuration (session-only).

Advances the change-thinking-level criterion of openpi-dev#348 and continues the
read-only GET /api/thinking inspection from openpi-dev#375/openpi-dev#444, preserving its
unknown fallback. Adds browser coverage (22 e2e incl. an axe pass) and a
hermetic provider e2e that proves the selected level reaches the next
provider request as reasoning_effort.
tt-a1i added a commit that referenced this pull request Sep 12, 2026
)

* feat(web): add a Pi-native thinking-level selector to the composer

Expose Pi's native thinking/reasoning level in the Web workbench: a
runtime setter with a bounded merge-to-latest, a lease-sensitive
POST /api/thinking, a bounded optional thinking projection with a
monotonic revision on the snapshot, a last-intent-wins client store
with a revision gate, and an icon-only composer picker with a disabled
placeholder for unsupported models. Levels come from Pi's
getAvailableThinkingLevels()/supportsThinking(); OpenPI adds no second
reasoning store and no persisted configuration (session-only).

Advances the change-thinking-level criterion of #348 and continues the
read-only GET /api/thinking inspection from #375/#444, preserving its
unknown fallback. Adds browser coverage (22 e2e incl. an axe pass) and a
hermetic provider e2e that proves the selected level reaches the next
provider request as reasoning_effort.

* test(web): make unsupported thinking fixture deterministic

---------

Co-authored-by: tt-a1i <53142663+tt-a1i@users.noreply.github.com>
Co-authored-by: tt-a1i <tt-a1i@users.noreply.github.com>
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.

2 participants