Skip to content

Warn the agent skill off pulling graphical-session.target - #8257

Open
kkoontz wants to merge 5 commits into
omacom:quattrofrom
kkoontz:skill-uwsm-graphical-session
Open

kkoontz wants to merge 5 commits into
omacom:quattrofrom
kkoontz:skill-uwsm-graphical-session

Conversation

@kkoontz

@kkoontz kkoontz commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Why

UWSM owns graphical-session.target. Omarchy's shipped user units already start with that target (WantedBy=) and never Requires= or Wants= it.

Agents following generic systemd GUI examples write Requires=graphical-session.target. That starts the target. If the user manager is already up (linger, a Persistent timer, an SSH session), UWSM prints A compositor or graphical-session* target is already active! and refuses to start Hyprland. Plymouth has quit; the screens stay black until the next boot.

The installed agent skill did not mention this, and its triggers did not include ~/.config/systemd/user/, so the skill often never loaded for that work.

What

  • Trigger the skill for user units, linger, and timers
  • Short safety note plus user-units.md, copying the pattern from $OMARCHY_PATH/default/systemd/user/
  • Point post-boot automation at omarchy hook install post-boot instead of pulling the session target

Reproduced with linger + a Persistent user timer + Requires=graphical-session.target: UWSM helper exits 1, Welcome to Hyprland never appears. An immediate reboot (timer already consumed) starts normally.

This is additive against current quattro. #6718 rewrites the skill more broadly; happy to rebase or fold into that if preferred.

UWSM owns that target. Requires=/Wants= from a linger or Persistent
user unit starts an empty session and Hyprland never launches.
Copilot AI balanced review requested due to automatic review settings August 25, 2026 18:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds agent guidance preventing user units from pulling UWSM’s graphical session target.

Changes:

  • Expands skill triggers for user units, timers, and linger.
  • Adds systemd user-unit safety guidance.
  • Recommends post-boot hooks for desktop automation.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
default/agents/skills/omarchy/user-units.md Documents safe user-unit patterns.
default/agents/skills/omarchy/SKILL.md Adds triggers, routing, and safety warnings.
default/agents/skills/omarchy/hooks.md Directs post-desktop automation to hooks.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +7 to +9
UWSM owns `graphical-session.target`. Omarchy's shipped user units under
`$OMARCHY_PATH/default/systemd/user/` start *with* that target via
`WantedBy=graphical-session.target`. They never `Requires=` or `Wants=` it.
Comment on lines +50 to +52
After editing units: `systemctl --user daemon-reload`. Then
`systemctl --user show graphical-session.target -p RequiredBy` must not
list the job.
A unit with Wants=graphical-session.target shows up in the target's WantedBy, not its RequiredBy, so the check passed the very dependency the guide forbids. Units that only name the target in [Install] WantedBy= appear in the target's Wants instead, so WantedBy stays empty on a stock install.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed by Claude Opus 5.5. This is Markdown only, so nothing was run; it was checked by reading every claim against quattro and the installed UWSM source.

What holds up:

  • Every shipped unit in default/systemd/user/ names graphical-session.target only through WantedBy=, After= or PartOf=; none Requires= or Wants= it. The session-daemon snippet matches omarchy-fcitx5.service and omarchy-crash-watch.service.
  • omarchy hook install post-boot <script> is real: omarchy-hook-install copies into ~/.config/omarchy/hooks/post-boot.d/, and default/hypr/autostart.lua runs omarchy-hook post-boot once Hyprland has started.
  • UWSM's main.py prints exactly A compositor or graphical-session* target is already active! and exits 1 when the target is already up, so a unit that pulls the target before login does leave the compositor unstarted.

One fix pushed to your branch (c5710d9): the closing check in user-units.md read only RequiredBy, so a unit with Wants=graphical-session.target — which the same page forbids — passed it. It now reads -p RequiredBy -p WantedBy. Units enabled with WantedBy=graphical-session.target in [Install] show up in the target's Wants, not its WantedBy, so on a stock install both stay empty.

Overlap: #6718 rewrites the same SKILL.md and hooks.md more broadly. It is not a competing fix, but whichever lands second will need the other folded in.

No second opinion ran: the configured reviewer (Codex Medium) had used up its daily review quota, so this has been checked by one model only. It waits on that review, and then on the maintainer.

omarchybot and others added 2 commits October 1, 2026 14:05
omarchy-recover-internal-monitor.service has to run before the session and is WantedBy=graphical-session-pre.target, so "the shipped units start with graphical-session.target" was not true of all of them. What holds for every one is that none Requires= or Wants= it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A unit enabled to start at boot under linger pulls the session target again on the next boot, so the reboot only helped when the trigger had already been consumed, as with the Persistent timer in the reproduction.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Codex Medium <noreply@openai.com>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 1, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

The second opinion has now run. Codex Medium reviewed the change against quattro and the installed UWSM source, alongside Claude Opus 5.5. As before, it is Markdown only, so nothing was run; every claim was checked by reading it against the repository.

Two wording fixes were pushed to your branch:

  • d7d09a1: user-units.md said the shipped units all start with WantedBy=graphical-session.target. omarchy-recover-internal-monitor.service has to run before the session and uses graphical-session-pre.target, as Copilot pointed out. The sentence now covers only the units that run with the session. What holds for every shipped unit, that none Requires= or Wants= the target, is unchanged.
  • 44ea88e: Codex found that "the screens stay black until the next boot" promised too much. Under linger, a unit enabled to start at boot pulls the target again on every boot, so a reboot only helps when the trigger has already been used up, as with the Persistent timer in your reproduction. It now says so.

On its second round Codex found nothing more. It agreed that the shipped-unit pattern, omarchy hook install post-boot, the UWSM refusal and the RequiredBy/WantedBy check are all as described. Its review can read this session's reasoning, so that agreement is not a guarantee of independence. The branch still merges cleanly into current quattro. #6718 still overlaps in SKILL.md and hooks.md, so whichever lands second will need the other folded in.

This is labelled verified. It is waiting on CI, which has not reported for this head, and then on the maintainer.

@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 3/5

[Low impact] Documentation for a system configuration skill.

The PR is not ready to merge because the revised hook guidance misstates when post-update runs and what sudo authorization it inherits.

Findings

  1. P2 Dependency check can miss jobs ▶

Summary

The PR expands the Omarchy agent skill's user-unit triggers and documents how to avoid starting graphical-session.target before UWSM. Changes since the previous review also revised update-hook guidance, two claims of which do not match the update sequence.

  • Adds a user-unit guide and points desktop-start automation to post-boot.
  • Correctly places the pacman-refresh hook before its package transaction, but inaccurately describes post-update timing and authorization.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[System packages and migrations] --> B[post-update hook]
  B --> C[Revoke update authorization]
  C --> D[AUR packages]
  D --> E[Boot-file verification]
  E --> F[Reboot offer]
Loading

Reviews (2) · Last reviewed commit: "Merge quattro into skill-uwsm-graphical-..." · Reviewed by Greptile

Comment on lines +52 to +54
After editing units: `systemctl --user daemon-reload`. Then
`systemctl --user show graphical-session.target -p RequiredBy -p WantedBy`
must not list the job.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Dependency check can miss jobs

After daemon-reload, this check can pass even if a newly written job has Requires=graphical-session.target or Wants=graphical-session.target: a job that has not been loaded may not appear in the target’s RequiredBy or WantedBy properties. That gives users false reassurance before the job’s first start, when it could start the target early and prevent UWSM from launching Hyprland. Please check the job’s own dependencies too.

@omarchybot omarchybot removed the verified Omarchy Triage has verified that this issue is ready for final review label Oct 11, 2026
omacom#5925 removed the skill body's "When This Skill MUST Be Used" list and moved its triggers into the frontmatter, where this branch had also added its own. Keep quattro's frontmatter and add this branch's systemd user unit path and triggers to it; the user-unit bullet this branch had added to the removed list goes with it, since the frontmatter now carries the same triggers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 11, 2026
@greptile-apps

greptile-apps Bot commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

Comments Outside Diff

These findings could not be posted inline.

  • P1 Post-update runs too early default/agents/skills/omarchy/hooks.md:17 ▶

    This says post-update runs at the end of the update, after privileged work. It actually runs before AUR packages are updated and before boot files are verified. A script that treats the hook as a completed-update signal can act on incomplete package state or report success even if boot verification later fails.

  • P1 Post-update retains sudo authorization default/agents/skills/omarchy/hooks.md:34 ▶

    The statement about revoked sudo authorization and the no-update wrapper is false for post-update. That hook runs while the update's sudo keepalive is active and without the wrapper. A hook author relying on this guidance can inadvertently run privileged commands without a fresh prompt.

@omarchybot omarchybot added the ready Good to merge label Oct 11, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

This stopped merging cleanly after #5925 landed on quattro, so I merged quattro into the branch (d25c0a8). #5925 removed the "When This Skill MUST Be Used" list from SKILL.md and moved its triggers into the frontmatter, which this branch also edits. The merge keeps #5925's frontmatter and adds this branch's ~/.config/systemd/user/ path and the user systemd units, linger, timers and autostart triggers to it. The bullet this branch had added to the removed list goes with that list, because the frontmatter now carries the same triggers. Against quattro the pull request is still the three Markdown files and nothing else.

I checked the guidance again against current quattro. None of the units in default/systemd/user/ Requires= or Wants= graphical-session.target, and that includes the new USB and Thunderbolt authorization services. The snippet in user-units.md still matches omarchy-fcitx5.service and omarchy-crash-watch.service. omarchy hook install post-boot still installs into hooks/post-boot.d/, and default/hypr/autostart.lua still runs those hooks after the desktop starts. Nothing here runs, so it was checked by reading rather than on a worker. Codex Medium reviewed the merge and the claims separately and found nothing wrong. Its review agrees with mine, and it is not guaranteed to be independent of it. CI is green.

This is now waiting on the maintainer.

@omarchybot omarchybot removed ready Good to merge verified Omarchy Triage has verified that this issue is ready for final review labels Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants