Skip to content

trunk-merge/pr-3580/23f98afc-1a6e-44cc-bccc-26dfb08dff61#3592

Closed
trunk-io[bot] wants to merge 17 commits into
mainfrom
trunk-merge/pr-3580/23f98afc-1a6e-44cc-bccc-26dfb08dff61
Closed

trunk-merge/pr-3580/23f98afc-1a6e-44cc-bccc-26dfb08dff61#3592
trunk-io[bot] wants to merge 17 commits into
mainfrom
trunk-merge/pr-3580/23f98afc-1a6e-44cc-bccc-26dfb08dff61

Conversation

@trunk-io

@trunk-io trunk-io Bot commented Jul 20, 2026

Copy link
Copy Markdown
Trunk Merge Pull Request Banner

This pull request was created and is being managed by Trunk Merge.

This pull request is based on the main branch at SHA 17394fe0be071a35bddb15c4805ed6d155c8f0e0.

See more details here.

When CI completes, this pull request will be closed automatically.

Pull Requests Being Tested

This pull request is testing the changes from pull request 3580.

Dependencies

This pull request depends on the changes from pull request 3556.

MattPua and others added 17 commits July 17, 2026 17:02
Generated-By: PostHog Code
Task-Id: 0de359df-d297-4750-b6a2-1aa301a85429
Generated-By: PostHog Code
Task-Id: 0de359df-d297-4750-b6a2-1aa301a85429
The injected `<channel_context>` block framed a channel's CONTEXT.md purely as
read-only reference material, so nothing told a task-doing agent to fix facts it
made stale — a renamed file, a flipped flag, a removed resource — and the doc
silently drifted for every later task.

Add a narrow upkeep carve-out to `buildChannelContextText`: if the agent's work
makes a fact wrong, correct just those lines via the PostHog MCP
`desktop-file-system-instructions-partial-update` tool, resolving the channel's
id and current instructions version at write time (neither is threaded into the
prompt) and patching in place. Scoped to material drift, opt-out when unsure.

Generated-By: PostHog Code
Task-Id: 4d7cc759-7d0a-4ef4-bb57-c06d45e01e3a
Generated-By: PostHog Code
Task-Id: 0de359df-d297-4750-b6a2-1aa301a85429
Generated-By: PostHog Code
Task-Id: 0de359df-d297-4750-b6a2-1aa301a85429
Greptile flagged that the upkeep write instruction identified its target channel
by display name (and emitted no identity at all when the name was absent), so the
agent could resolve to the wrong same-named channel or skip the update.

Thread the channel's desktop file-system id through task creation as a new
`channelContextId` (distinct from the backend feed `channelId`) and embed it
verbatim in the injected context, so the agent addresses the CONTEXT.md by that
exact id via `desktop-file-system-instructions-partial-update` — never by name.
The upkeep instruction is now emitted only when that id is known; otherwise the
context stays pure reference material with no write instruction. Also tells the
agent to skip the write when the MCP tool isn't reachable (e.g. runtimes without
it), addressing the tool-availability concern.

Wired from both channel task entry points (WebsiteNewTask, ChannelHomeComposer),
which already hold the folder id used to fetch the CONTEXT.md.

Generated-By: PostHog Code
Task-Id: 4d7cc759-7d0a-4ef4-bb57-c06d45e01e3a
Generated-By: PostHog Code
Task-Id: 0de359df-d297-4750-b6a2-1aa301a85429
Generated-By: PostHog Code
Task-Id: 0de359df-d297-4750-b6a2-1aa301a85429
Generated-By: PostHog Code
Task-Id: 0de359df-d297-4750-b6a2-1aa301a85429
Generated-By: PostHog Code
Task-Id: 0de359df-d297-4750-b6a2-1aa301a85429
Generated-By: PostHog Code
Task-Id: 0de359df-d297-4750-b6a2-1aa301a85429
6 updated, 28 removed
Run: fdc32692-6abc-4e10-a7cb-4e1060215a23

Co-authored-by: MattPua <3376526+MattPua@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

React Doctor found 4 issues in 1 file · 4 warnings.

4 warnings

src/features/autoresearch/AutoresearchObservability.tsx

Reviewed by React Doctor for commit 61f0ee1.

@posthog

posthog Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

👋 Visual changes detected for this PR.

Review and approve in PostHog Visual Review

If these changes are unexpected, they may be caused by a flaky test or a broken snapshot on master. Don't approve — rerun the job or wait for a fix.

@trunk-io trunk-io Bot closed this Jul 20, 2026
@trunk-io
trunk-io Bot deleted the trunk-merge/pr-3580/23f98afc-1a6e-44cc-bccc-26dfb08dff61 branch July 20, 2026 15:50
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