An expired GitHub token exported in the environment made PR syncing fail with a 401, even when `gh` could still resolve a working credential. gitcrawl takes the first non-empty value of `GITHUB_TOKEN` and only finds out it is invalid when GitHub rejects it, so the stale value was sent on every call. That is easy to hit in a long-lived session, where a wrapper exports an installation token that expires after an hour and never refreshes.
Each sync now resolves a fresh credential from the `gh` CLI and passes it to gitcrawl, so the exported value is never consulted. `gh auth token` is asked with `GH_TOKEN` and `GITHUB_TOKEN` removed from the child environment — in every casing, since Windows treats environment names case-insensitively — because `gh` returns those variables verbatim and would otherwise hand back the same credential being replaced.
The author permission and GitHub app owner lookups use the same credential. Both spawn `gh` without options and inherited the same stale token: the app owner lookup swallowed the resulting 401 into `undefined`, which made authorization read as "not authorized" and silently disabled permission gating instead of reporting an error.
Verified against the real `gh` and `gitcrawl` binaries with a stale token exported, alongside focused unit tests, the package test suite, typecheck, lint, and format checks.
GitHub Signals can now accept comments from unlisted GitHub App bots
when the app is owned by the repository organization or by a user with
an authorized repository permission. Explicit ignore entries still win,
and failed or unsupported owner lookups remain denied.
This keeps `authorizedBots` as the explicit allowlist, reuses
`authorizedPermissions` for user app owners, and caches successful owner
lookups for 24 hours. It includes focused tests, documentation, and a
minor changeset.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## ELI5
GitHub Signals can now recognize comments from certain GitHub App bots
without listing every bot manually. It trusts apps owned by the
repository organization or by users with sufficient repository access,
while keeping explicit blocks effective.
## Changes
- Added `GithubAppOwnerResolver` to resolve GitHub App owners with `gh
api apps/{slug}`.
- Cached successful owner lookups for 24 hours.
- Authorized organization-owned apps when the owner matches the
repository organization.
- Authorized user-owned apps through `authorizedPermissions`.
- Preserved `authorizedBots` as the explicit allowlist.
- Applied explicit ignore entries before all other checks.
- Denied unresolved, unsupported, malformed, or failed owner lookups.
- Prevented stale polling generations from authorizing comments or
writing cache entries.
- Used `raw_json.submitted_at` for GitHub review timestamps when needed.
- Added focused tests for owner resolution, caching, authorization,
denial, cancellation, and review snapshots.
- Updated GitHub Signals documentation and added a changeset.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: remy-builder[bot] <4813995+remy-builder[bot]@users.noreply.github.com>
The `notification_inbox` tool had no way for notifications to leave
`pending` unless the agent called `markSeen`/`dismiss` one id at a time.
Notifications that were only surfaced through a summary digest stayed
pending forever, so every `list` returned the whole backlog. In one live
session that was 96 GitHub records (~360KB of JSON) in a single tool
result, which pushed the thread straight past the observational-memory
threshold and forced a synchronous observation every turn.
Now viewing a notification counts as reading it. `list`, `read`, and
`search` mark the returned unread records seen, `list` defaults to
unread records and a page of 20, and the response reports `hasMore` and
`markedSeen`. Internal `metadata` / `payload` bookkeeping is dropped
from the agent-facing records.
Before, every call returned everything, forever:
```ts
await tool.execute({ action: 'list' });
// { notifications: [ /* all 96, full metadata, still pending */ ] }
await tool.execute({ action: 'list' });
// same 96 again
```
After, repeated lists drain the backlog:
```ts
await tool.execute({ action: 'list' });
// { notifications: [ /* 20, status: 'seen', no metadata/payload */ ], hasMore: true, markedSeen: 20 }
await tool.execute({ action: 'list' });
// { notifications: [ /* next 20 */ ], hasMore: true, markedSeen: 20 }
```
On the GitHub side, PR notification records were mirroring every
agent-facing field (title, state, comment excerpt, full check objects)
into `metadata.github` on top of `attributes`, roughly doubling each
record. `metadata.github` now only keeps the sync bookkeeping the change
detector needs. Check names live in `attributes` as flat strings since
signal attributes are rendered with `String(value)`, and failing checks
get a `failingCheckUrls` attribute so the agent can link to the run.
`GithubSignalAgent.sendNotificationSignal` is now typed with
`SendNotificationSignalInput` instead of `unknown` so a non-scalar
attribute fails typecheck.
```ts
attributes: {
ciState: 'failure',
failingChecks: 'Quality assurance',
failingCheckUrls: 'Quality assurance: https://github.com/mastra-ai/mastra/actions/runs/1',
}
```
Tests cover the drain (25 pending → 20 + 5 disjoint pages → empty), the
`markedSeen` count when a status write fails, the stripped projection,
and that every GitHub notification attribute is a scalar. Verified with
`packages/core` notifications + agent-signals suites, `signals/github`,
and `mastracode/sdk` extra-tools, plus typecheck and lint on the touched
packages.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## ELI5
When an agent views notifications, the tool marks them as seen. It shows
unread notifications first, supports paging, and hides internal data
from agent responses.
## Changes
- Updated `notification_inbox`:
- Defaults `list` to unread notifications.
- Returns pages of 20 notifications.
- Reports `hasMore` and `markedSeen`.
- Marks returned unread notifications as seen for `list`, `read`, and
`search`.
- Requires a search query for `search`.
- Requires a non-empty `id` for `markSeen`, `dismiss`, and `archive`.
- Omits internal `metadata` and `payload` fields.
- Reports only successfully updated notifications as seen.
- Updated GitHub notifications:
- Stores agent-facing fields as scalar attributes.
- Removes duplicated fields from `metadata.github`.
- Adds `failingCheckUrls` for failed checks.
- Preserves review-mode change-detection fields.
- Uses the typed `SendNotificationSignalInput`.
- Added patch changesets for `@mastra/core` and
`@mastra/github-signals`.
- Expanded tests for pagination, backlog draining, status-write
failures, response projections, whitespace-only IDs, schema validation,
and GitHub attributes.
- Updated related SDK expectations and package test, typecheck, and lint
coverage.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: mastra-platform[bot] <284800079+mastra-platform[bot]@users.noreply.github.com>
PR #23214 introduced a patch-level breaking change by suppressing
reactive and system-reminder events from live streams without an opt-in.
This restores the previous default and adds caller-local `hideSignals`
for streams, thread subscriptions, and memory recall. Model context,
storage, transforms, and other subscribers remain unchanged; recall
keeps its existing defaults. Shared execution options accept
`hideSignals` on `generate()` and `resumeGenerate()` without filtering
their results.
```ts
const output = await agent.stream('Review the changes', {
hideSignals: ['reactive', 'system-reminder'],
});
```
Separately, fixes AGENTS.md discovery when completed tool results move
between message sets. Instruction lookup scans newest-first,
deduplicates covered paths, and preserves trusted-ref isolation across
filesystem aliases. Observational memory behavior is unchanged.
Verified with focused core, memory, SDK, and consumer suites; terminal
E2E checks for instruction loading and notifications; and clean-HEAD
CLI/built-package proofs for injection, live visibility, independent
filtering/replay, and recall. The latest cleanup additionally passes 214
focused runtime tests, type/parity checks, and the docs production
build, including regular/durable generate and resume no-op coverage.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## ELI5
Live streams now show important updates by default. Callers can hide all
or selected signal types without changing saved data, model context, or
generated results. The PR also improves `AGENTS.md` discovery when tool
results move or use filesystem aliases.
## Changes
- Restored `reactive` and `system-reminder` signals in live, replayed,
durable, and thread streams.
- Added caller-local `hideSignals` filtering for streams, thread
subscriptions, and `Memory.recall()`.
- Supported boolean and selected signal-type filters with legacy
signal-name normalization.
- Preserved unfiltered signals for model context, storage, transforms,
shared fanout, and aggregate results.
- Added `hideSignals` support to `generate()` and `resumeGenerate()`
without filtering their results.
- Preserved deprecated `includeSystemReminders` behavior and precedence
rules.
- Improved instruction discovery with newest-first scanning, moved
tool-result handling, path deduplication, filesystem identity
resolution, and trusted Git-reference paths.
- Added documentation and runtime, memory, SDK, type, CLI, terminal E2E,
built-package, and documentation coverage.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: mastra-platform[bot] <284800079+mastra-platform[bot]@users.noreply.github.com>
## Summary
- update stale processor and GitHub Signal tests to stop expecting
reactive system reminders in live chunk streams
- update the CLI dev fixture for the current `statSync`-based entry-file
lookup
- align the Mastra Code goal-handoff E2E assertion with the rendered
plan UI
These test corrections unblock verification of #23189 without changing
its provider-metadata implementation.
## Test plan
- focused Core processor and workflow tests (172 passed)
- CLI unit suite (1,107 passed)
- GitHub Signals suite (104 passed)
- AI SDK helper tests (19 passed)
- Core MessageList v6 tests (25 passed)
- focused `plan-approval-goal-handoff` Mastra Code E2E (passed)
- Core, CLI, and Mastra Code typechecks
- Prettier, Oxlint, and `git diff --check`
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## ELI5
This PR keeps tool information intact when messages travel between
Mastra and the AI SDK. It also updates tests and fixtures to match
current stream and UI behavior.
## Changes
- Preserve tool-result `providerMetadata`, including
`mastra.modelOutput`, across AI SDK v5 and v6 conversions.
- Merge tool-call and tool-result metadata, with result metadata taking
precedence.
- Detect v6 messages that contain `resultProviderMetadata`.
- Add regression tests for metadata preservation, merging, and omission
when absent.
- Add patch changesets for `@mastra/core` and `@mastra/ai-sdk`.
- Update processor and GitHub Signal tests to expect no reactive
`data-signal` stream chunks.
- Update the CLI development fixture for `statSync` file detection.
- Align the Mastra Code goal-handoff test with the current rendered plan
flow.
- Update the goal-step test to verify persisted feedback without live
signal output.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Lucas Pradel <169302645+pradelgorithm@users.noreply.github.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
This adds multi-PR GitHub signal subscriptions so a thread can follow
several PRs at once from the TUI or through the GitHub signal tools.
The GitHub command now opens a small menu with subscribe, unsubscribe,
list, token, poll interval, sync, and debug actions. Subscribe uses a
picker with “my PRs” and repo search, supports space-to-select multiple
PRs, and shows a loading state while `gh pr list` runs. Existing inline
commands still work, including review/working mode:
```txt
/github subscribe mastra-ai/mastra#123 --mode review
/github unsubscribe mastra-ai/mastra#123
/github sync
/github debug
```
The agent tools now use a clearer batch shape instead of mixing legacy
top-level PR fields:
```json
{
"prs": [
{ "owner": "mastra-ai", "repo": "mastra", "number": 123 },
{ "owner": "mastra-ai", "repo": "mastra", "number": 456 }
],
"mode": "working"
}
```
Unsubscribe supports the same `prs` array or `all: true`. Stored
subscription data remains backward compatible, including older
subscriptions without a mode or dedupe key.
This also adds poll interval settings, shows `2 PRs` in the status line
when multiple PRs are followed, filters low-value bot comments like
CodeRabbit “review skipped”/change-stack noise, and avoids re-sending
the same latest comment notification when only PR bookkeeping changes.
Verified with focused provider, SDK, TUI, and GitHub e2e coverage after
rebasing onto latest main.
<img width="1952" height="826" alt="image (52)"
src="https://github.com/user-attachments/assets/9c0977a0-c9ab-490f-bdd5-3a02fe7a3c9b"
/>
<img width="1498" height="866" alt="image (53)"
src="https://github.com/user-attachments/assets/4abea093-43be-4fa8-8bd0-4abab7b66a00"
/>
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## ELI5
This PR lets users track several GitHub pull requests at once. It adds
menus and search tools to manage subscriptions, reduces duplicate or
unhelpful notifications, and keeps existing subscriptions working.
## Changes
- Added multi-PR subscribe and unsubscribe support through GitHub tools
and TUI commands.
- Added GitHub Signals actions for subscribe, unsubscribe, list,
unsubscribe all, token help, poll interval, sync, and debug.
- Added a searchable PR picker with “My open PRs” and repository search
views.
- Added configurable polling intervals with validation and persistence.
- Added batch tool inputs through a `prs` array with per-PR results and
subscription summaries.
- Preserved legacy ownerless subscription IDs, inline commands, and
review/working modes.
- Rejected ambiguous ownerless legacy PR IDs when multiple
repository-qualified candidates exist.
- Filtered repetitive low-value bot comments.
- Prevented duplicate notifications for unchanged latest comments.
- Invalidated active polling before subscription updates and restarted
polling when subscriptions remained.
- Updated the status line to show one PR number or a count of active
subscriptions.
- Added provider, SDK, TUI, settings, and end-to-end coverage.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Mastra Code (openai/gpt-5.5) <noreply@mastra.ai>
## Summary
This PR fixes processor message reapplication so processors that return
a message array do not collapse assistant response boundaries when those
messages are written back to the agent message list.
The bug showed up with no-op `processOutputStep` processors running
alongside task state signals: reapplying the returned message array used
the normal message merge path, which could merge separate assistant
response messages together. That made later loop steps see stale
text/tool content from earlier steps.
Changes included here:
- Add a `merge: false` option to `MessageList.add()` and use it for
processor message-array reapply paths.
- Add AIMock regression coverage for no-op output step processors,
including TaskSignalProvider scenarios that previously replayed stale
step content.
- Update output processor unit expectations to preserve separate
assistant messages instead of relying on accidental re-merge behavior.
- Change GitHub signals' output-step processor to return `undefined`
when it only performs side effects, avoiding unnecessary
unchanged-message reapplication.
- Stabilize the GitHub polling inbox E2E assertion by checking the
visible tool result instead of shelling out to sqlite from the TUI.
## Test plan
- `pnpm exec vitest run
packages/core/src/loop/test-utils/aimock/scenarios/output-step-processor.scenario.test.ts
packages/core/src/processors/runner.test.ts --bail 1 --reporter=dot`
- `pnpm --filter @mastra/github-signals test -- --reporter=dot`
- `pnpm --filter ./packages/core check`
---------
Co-authored-by: Mastra Code (openai/gpt-5.5) <noreply@mastra.ai>