Skip to content

fix: restore watch defaults and align agent status, undo, cron fork, and completion budget behavior - #336

Merged
elkaix merged 3 commits into
fix/rollback-trust-hardeningfrom
fix/session-behavior-defaults
Oct 1, 2026
Merged

elkaix merged 3 commits into
fix/rollback-trust-hardeningfrom
fix/session-behavior-defaults

Conversation

@elkaix

@elkaix elkaix commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Requirement or Bug

Restore filesystem-watch defaults and land a batch of session-behavior fixes (agent status, undo, cron forks, completion budget).

Bug Reproduction Steps

N/A (behavior restore + fixes).

Root Cause

Watch was flipped off by default when it should not have been; permission-mode changes never reached agent status consumers; undo left a stale interruption reminder; forks inherited the source session's cron tasks; a default completion token cap silently truncated model output. Each fixed at the cause.

Code Changes

  • Filesystem watch defaults back on ([watch] enabled = false / PYTHINKER_CODE_WATCH=0 to disable).
  • setMode publishes permission mode on AgentStatusUpdated.
  • NotifyUser nudges only for clients with an updates panel (notifyUserAvailable host gate).
  • Undo removes a turn's interruption reminder with the turn.
  • Forks clear inherited cron tasks and surface a one-shot notice.
  • The default completion token cap is gone; set maxCompletionTokens in modelOverrides to cap output. usedContextTokens reads the tokenizer size.

Impact Scope

  • packages/agent-core-v2 (watch, nudge, permission mode, interruption reminder, cron runtime, usage/traits/requesters), apps/vis event types, docs (config-files.md).
  • Tests: suites for each behavior above; full suite green locally.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue (external PRs: issue must have a maintainer's /approve). — No public issue; maintainer work.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

elkaix and others added 2 commits September 30, 2026 21:29
…pletion budget behavior

Watchers default back on, NotifyUser nudges respect the host update
panel, permission mode changes publish agent.status.updated, undo drops
its turn's interruption reminder, forks clear inherited cron tasks with
a notice, and the completion token cap is only sent when configured.
@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (1)
  • main

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository: PyModel/pythinker-code/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 97937a5b-bc1a-4776-b443-7c48937ea13a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Oct 1, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@pymodel/pythinker-code@40c13ac
npx https://pkg.pr.new/@pymodel/pythinker-code@40c13ac

commit: 40c13ac

…337)

## Requirement or Bug

Make workspace trust transparent: a headless trust opt-out and a prompt
that shows what trusting would activate.

## Bug Reproduction Steps

N/A (features).

## Root Cause

Headless runs had no way to pre-trust a workspace, and the trust prompt
asked for a decision without showing what it would enable. Both
addressed at the service layer.

## Code Changes

- New `PYTHINKER_CODE_TRUST_WORKSPACE=1` env var trusts the current
workspace for headless runs without answering the trust prompt; untrust
reports the effective state.
- The workspace trust prompt now lists the MCP servers, extra
directories, and project instruction sources that trusting would
activate, backed by a typed `WorkspaceTrustDisclosureService`.
- SDK `getWorkspaceTrustInfo` gains `origin`, `gatedAdditionalDirs`,
`additionalDirSources`, `warnings`, and `instructionSources`.
- Docs: `env-vars.md`, `mcp.md` rows for the new variable and warning
text.

## Impact Scope

- `packages/agent-core-v2` (workspaceTrust domain, program wiring, trust
prompt, mcpRegistry), `packages/agent-gateway` (env trust, untrust
report), `packages/node-sdk` (trust info shape), CLI (`cli/v2` MCP
warning), docs.
- Tests: env-trust, disclosure, trust-prompt, gateway, and SDK suites;
full suite green locally.

## Checklist

- [x] I have read the
[CONTRIBUTING](https://github.com/PyModel/pythinker-code/blob/main/CONTRIBUTING.md)
document.
- [x] I have linked a related issue (external PRs: issue must have a
maintainer's `/approve`). — No public issue; maintainer work.
- [x] I have added tests that prove my feature works.
- [x] Ran `gen-changesets` skill, or this PR needs no changeset.
- [x] Ran `gen-docs` skill, or this PR needs no doc update.

---------

Co-authored-by: Test User <test@example.test>
@elkaix
elkaix merged commit 660d626 into fix/rollback-trust-hardening Oct 1, 2026
19 checks passed
@elkaix
elkaix deleted the fix/session-behavior-defaults branch October 1, 2026 03:27
elkaix added a commit that referenced this pull request Oct 1, 2026
The #336 merge moved pnpm-lock.yaml without updating flake.nix, so
every nix build on this branch fails the fixed-output hash check.
Set the pnpmDeps hash to the value the CI build reported and verify
nix build .#pythinker-code.pnpmDeps locally.
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.

1 participant