PluginProbe
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin / 1.1.10
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin v1.1.10
1.1.10 1.1.9 1.1.8 1.1.7 1.1.6 1.1.5 1.1.4 1.1.3 1.1.2 1.1.1 1.1.0 1.0.1 1.0.0 0.9.8 0.9.7 0.9.6 0.9.4 0.9.5 0.9.3 0.9.2 0.9.1 0.9.0 0.8.9 0.8.8 0.8.7 All 34 releases
← All changes | includes/agents/runner.php +28 -0 1.1.21.1.10 View file →
@@ -177,8 +177,9 @@
177 177 return $rate;
178 178 }
179 179
180 180 $instructions = openstation_agent_get_instructions( $user->ID );
181 + $instructions = openstation_agent_apply_vibes( $instructions, (int) $user->ID );
181 182 $abilities = openstation_agent_get_abilities( $user->ID );
182 183
183 184 list( $tool_defs, $slug_by_name ) = openstation_agent_runner_build_tools( $abilities );
184 185
@@ -972,8 +973,35 @@
972 973 array( 'source' => 'agents/runner' )
973 974 );
974 975 }
975 976 );
977 +}
978 +
979 +/**
980 + * Append an agent's voice line to its instructions.
981 + *
982 + * **After the instructions, never before.** The two can disagree — a
983 + * voice that says "blunt" against a workflow that says "always explain
984 + * your reasoning" — and when they do, the workflow should win. Later
985 + * text is the one the model weights more heavily, so position is the
986 + * whole mechanism here.
987 + *
988 + * The line is stored through `openstation_agent_sanitize_vibes()`,
989 + * which strips line breaks. That matters more than it looks: the
990 + * composed prompt marks operator turns, and a multi-line voice line
991 + * could otherwise fake a turn boundary. `agentsSecurity.php` pins it.
992 + *
993 + * @param string $instructions The agent's system prompt.
994 + * @param int $user_id Agent user id.
995 + * @return string
996 + */
997 +function openstation_agent_apply_vibes( $instructions, $user_id ) {
998 + $vibes = openstation_agent_get_vibes( $user_id );
999 + if ( '' === $vibes ) {
1000 + return $instructions;
1001 + }
1002 + $line = 'Voice: ' . $vibes;
1003 + return '' === $instructions ? $line : $instructions . "\n\n" . $line;
976 1004 }
977 1005
978 1006 /**
979 1007 * Run a callback with the WordPress HTTP timeout raised for the